📄 problem 1101.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://acm.zju.edu.cn/show_problem.php?pid=1101 -->
<HTML><HEAD><TITLE>Problem 1101</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR></HEAD>
<BODY>
<CENTER><IMG src="Problem 1101.files/logo.gif" align=center></IMG></CENTER>
<HR>
<CENTER><FONT color=blue size=+2>Gamblers</FONT></CENTER>
<HR>
<CENTER><FONT color=green>Time limit:</FONT> 1 Seconds <FONT
color=green>Memory limit: </FONT>32768K </FONT><BR><FONT
color=green>Total Submit:</FONT> 4640 <FONT color=green>Accepted
Submit:</FONT> 890 </CENTER>
<HR>
<P>A group of <I>n</I> gamblers decide to play a game:
<P>At the beginning of the game each of them will cover up his wager on the
table and the assitant must make sure that there are no two gamblers have put
the same amount. If one has no money left, one may borrow some chips and his
wager amount is considered to be <I>negative</I>. Assume that they all bet
integer amount of money.
<P>Then when they unveil their wagers, the winner is the one who's bet is
exactly the same as the sum of that of 3 other gamblers. If there are more than
one winners, the one with the largest bet wins.
<P>For example, suppose Tom, Bill, John, Roger and Bush bet $2, $3, $5, $7 and
$12, respectively. Then the winner is Bush with $12 since $2 + $3 + $7 = $12 and
it's the largest bet.
<P>
<H3>Input</H3>Wagers of several groups of gamblers, each consisting of a line
containing an integer 1 <= n <= 1000 indicating the number of gamblers in
a group, followed by their amount of wagers, one per line. Each wager is a
distinct integer between -536870912 and +536870911 inclusive. The last line of
input contains 0.
<H3>Output</H3>For each group, a single line containing the wager amount of the
winner, or a single line containing "no solution".
<H3>Sample Input</H3><PRE>5
2
3
5
7
12
5
2
16
64
256
1024
0
</PRE>
<H3>Output for Sample Input</H3><PRE>12
no solution
</PRE>
<HR>
<CENTER><A href="http://acm.zju.edu.cn/submit.php?pid=1101">Submit</A>
<A href="http://acm.zju.edu.cn/list_problem.php?vol=2">Back</A>
<A
href="http://acm.zju.edu.cn/problem_status.php?pid=1101">Status</A> </CENTER>
<HR>
<CENTER><A href="http://acm.zju.edu.cn/"><FONT color=red>Zhejiang University
Online Judge</FONT></A> <A href="http://acm.zju.edu.cn/"><FONT
color=red>V1.0</FONT></A><BR></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -