mirror of
https://github.com/xlucn/PAT.git
synced 2026-11-05 06:37:35 +08:00
25 lines
3.1 KiB
HTML
25 lines
3.1 KiB
HTML
开学寄语
|
||
<div class="ques-view"><p>下图是上海某校的新学期开学寄语:天将降大任于斯人也,必先删其微博,卸其 QQ,封其电脑,夺其手机,收其 ipad,断其 wifi,使其百无聊赖,然后,净面、理发、整衣,然后思过、读书、锻炼、明智、开悟、精进。而后必成大器也!</p>
|
||
<p><img alt="jiyu.JPG" src="https://images.ptausercontent.com/3b1d9f4a-778b-4942-a9e2-836262f363aa.JPG"/></p>
|
||
<p>本题要求你写个程序帮助这所学校的老师检查所有学生的物品,以助其成大器。</p>
|
||
<h3 id="-">输入格式:</h3>
|
||
<p>输入第一行给出两个正整数 N(<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)和 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> 6),分别是学生人数和需要被查缴的物品种类数。第二行给出 M 个需要被查缴的物品编号,其中编号为 4 位数字。随后 N 行,每行给出一位学生的姓名缩写(由 1-4 个大写英文字母组成)、个人物品数量 K(0 <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> K <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> 10)、以及 K 个物品的编号。</p>
|
||
<h3 id="-">输出格式:</h3>
|
||
<p>顺次检查每个学生携带的物品,如果有需要被查缴的物品存在,则按以下格式输出该生的信息和其需要被查缴的物品的信息(注意行末不得有多余空格):</p>
|
||
<pre><code>姓名缩写: 物品编号1 物品编号2 ……
|
||
</code></pre><p>最后一行输出存在问题的学生的总人数和被查缴物品的总数。</p>
|
||
<h3 id="-">输入样例:</h3>
|
||
<pre><code class="lang-in">4 2
|
||
2333 6666
|
||
CYLL 3 1234 2345 3456
|
||
U 4 9966 6666 8888 6666
|
||
GG 2 2333 7777
|
||
JJ 3 0012 6666 2333
|
||
</code></pre>
|
||
<h3 id="-">输出样例:</h3>
|
||
<pre><code class="lang-out">U: 6666 6666
|
||
GG: 2333
|
||
JJ: 6666 2333
|
||
3 5
|
||
</code></pre>
|
||
</div> |