Files
PAT/source/html/b1069.html
T

33 lines
1.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
微博转发抽奖
<div class="ques-view"><p>小明 PAT 考了满分,高兴之余决定发起微博转发抽奖活动,从转发的网友中按顺序每隔 N 个人就发出一个红包。请你编写程序帮助他确定中奖名单。</p>
<h3 id="-">输入格式:</h3>
<p>输入第一行给出三个正整数 M(<span class="katex"><span class="katex-mathml"><math><mrow><mo>≤</mo></mrow>\le</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.63597em;"></span><span class="strut bottom" style="height:0.7719400000000001em;vertical-align:-0.13597em;"></span><span class="base textstyle uncramped"><span class="mrel">≤</span></span></span></span> 1000)、N 和 S,分别是转发的总量、小明决定的中奖间隔、以及第一位中奖者的序号(编号从 1 开始)。随后 M 行,顺序给出转发微博的网友的昵称(不超过 20 个字符、不包含空格回车的非空字符串)。</p>
<p>注意:可能有人转发多次,但不能中奖多次。所以如果处于当前中奖位置的网友已经中过奖,则跳过他顺次取下一位。</p>
<h3 id="-">输出格式:</h3>
<p>按照输入的顺序输出中奖名单,每个昵称占一行。如果没有人中奖,则输出 <code>Keep going...</code>。</p>
<h3 id="-1-">输入样例 1:</h3>
<pre><code class="lang-in">9 3 2
Imgonnawin!
PickMe
PickMeMeMeee
LookHere
Imgonnawin!
TryAgainAgain
TryAgainAgain
Imgonnawin!
TryAgainAgain
</code></pre>
<h3 id="-1-">输出样例 1:</h3>
<pre><code class="lang-out">PickMe
Imgonnawin!
TryAgainAgain
</code></pre>
<h3 id="-2-">输入样例 2:</h3>
<pre><code class="lang-in">2 3 5
Imgonnawin!
PickMe
</code></pre>
<h3 id="-2-">输出样例 2:</h3>
<pre><code class="lang-out">Keep going...
</code></pre>
</div>