Files
PAT/html/b1082.html
T

32 lines
1.1 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.
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h1>1082. 射击比赛 (20)</h1>
<div id="problemContent">
<p>本题目给出的射击比赛的规则非常简单,谁打的弹洞距离靶心最近,谁就是冠军;谁差得最远,谁就是菜鸟。本题给出一系列弹洞的平面坐标(x,y),请你编写程序找出冠军和菜鸟。我们假设靶心在原点(0,0)。
</p>
<p><b>
输入格式:
</b></p>
<p>
输入在第一行中给出一个正整数 N(&lt;= 10 000)。随后 N 行,每行按下列格式给出:</p>
<pre>
ID x y
</pre>
<p>其中 ID 是运动员的编号(由4位数字组成);x 和 y 是其打出的弹洞的平面坐标(x,y),均为整数,且 0 &lt;= |x|, |y| &lt;= 100。题目保证每个运动员的编号不重复,且每人只打 1 枪。
</p>
<p><b>
输出格式:
</b></p>
<p>
输出冠军和菜鸟的编号,中间空 1 格。题目保证他们是唯一的。
</p>
<b>输入样例:</b><pre>
3
0001 5 7
1020 -1 3
0233 0 -1
</pre>
<b>输出样例:</b><pre>
0233 0001
</pre>
</div>