ZOJ P1101 Gamblers(赌徒) 题目 英文版
2018-03-10 11:07
323 查看
Gamblers
Time Limit: 2 Seconds Memory Limit: 65536 KB
因为考虑到很多小同学不会这么高深的英文,所以在此提供中文版题目(点击即可查看)
A group of n gamblers decide to play a game:
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 negative. Assume that they all bet integer amount of money.
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.
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.
one per line. Each wager is a distinct integer between -536870912 and +536870911 inclusive. The last line of input contains 0.
Time Limit: 2 Seconds Memory Limit: 65536 KB
因为考虑到很多小同学不会这么高深的英文,所以在此提供中文版题目(点击即可查看)
A group of n gamblers decide to play a game:
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 negative. Assume that they all bet integer amount of money.
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.
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.
Input
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.
Output
For each group, a single line containing the wager amount of the winner, or a single line containing "no solution".Sample Input
5 2 3 5 7 12 5 2 16 64 256 1024 0
Output for Sample Input
12 no solution
相关文章推荐
- ZOJ P1101 Gamblers(赌徒) 题目 中文版
- 九度OJ—题目1032:ZOJ
- 浙大 ZOJ 题目分类【转】
- 博弈类题目小结(HDU,POJ,ZOJ)
- ZOJ 题目分类 The beginner problem
- 题目1006:ZOJ问题
- ZOJ 题目分类1
- ZOJ 1045 题目大意:叠放卡片,使上面第一张盖住第二张的1/2,第二张盖第三张的1/3,依次类推,输出达到c的最少卡片数
- zoj浙大acm题目分类整理
- ZOJ 1101 Gamblers
- 博弈类题目小结(HDU,POJ,ZOJ)
- ZOJ题目分类
- 题目1006:ZOJ问题
- ZOJ 题目3228 Searching the String(AC自动机,子川匹配个数)
- 使用map 解“英文版 A+B”题目
- ZOJ 题目分类
- ZOJ 题目分类 Simulation Problems
- ZOJ 3713 In 7-bit (题目巨难懂)
- 博弈类题目小结(HDU,POJ,ZOJ)
- zoj 1101 Gamblers 跳多重循环!!