mirror of
https://github.com/xlucn/PAT.git
synced 2026-11-04 00:38:13 +08:00
18 lines
2.2 KiB
HTML
18 lines
2.2 KiB
HTML
射击比赛
|
||
<div class="ques-view"><p>本题目给出的射击比赛的规则非常简单,谁打的弹洞距离靶心最近,谁就是冠军;谁差得最远,谁就是菜鸟。本题给出一系列弹洞的平面坐标(x,y),请你编写程序找出冠军和菜鸟。我们假设靶心在原点(0,0)。</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> 10 000)。随后 N 行,每行按下列格式给出:</p>
|
||
<pre><code>ID x y
|
||
</code></pre><p>其中 <code>ID</code> 是运动员的编号(由 4 位数字组成);<code>x</code> 和 <code>y</code> 是其打出的弹洞的平面坐标(<code>x</code>,<code>y</code>),均为整数,且 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> |<code>x</code>|, |<code>y</code>| <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> 100。题目保证每个运动员的编号不重复,且每人只打 1 枪。</p>
|
||
<h3 id="-">输出格式:</h3>
|
||
<p>输出冠军和菜鸟的编号,中间空 1 格。题目保证他们是唯一的。</p>
|
||
<h3 id="-">输入样例:</h3>
|
||
<pre><code class="lang-in">3
|
||
0001 5 7
|
||
1020 -1 3
|
||
0233 0 -1
|
||
</code></pre>
|
||
<h3 id="-">输出样例:</h3>
|
||
<pre><code class="lang-out">0233 0001
|
||
</code></pre>
|
||
</div> |