BestCoder Round #50 (div.2) HDU5364 Distribution money 排序+模拟
2015-10-08 22:46
447 查看
Distribution money
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 665 Accepted Submission(s): 349
Problem Description
AFA want to distribution her money to somebody.She divide her money into n same parts.One who want to get the money can get more than one part.But if one man's money is more than the sum of all others'.He shoule be punished.Each one who get a part of money
would write down his ID on that part.
Input
There are multiply cases.
For each case,there is a single integer n(1<=n<=1000) in first line.
In second line,there are n integer a1,a2...an(0<=ai<10000)ai is the the ith man's ID.
Output
Output ID of the man who should be punished.
If nobody should be punished,output -1.
Sample Input
3 1 1 2 4 2 1 4 3
Sample Output
1 -1
Source
BestCoder Round #50 (div.2)
出题人:这题没什么好说的,排个序直接模拟一下就好了
相关文章推荐
- 第2章 变量和基本类型
- 神经网络的反向传播BP算法
- Count Primes
- python学习进阶一
- 在mvc中 怎么给@Html.HiddenFor()赋值
- TCP那些事
- 信息安全系统设计基础第三周学习总结
- Python中使用Flask、MongoDB搭建简易图片服务器
- 无效绑定问题:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 字符串匹配之horspool算法
- 7天hadoop(二)linux的常用命令
- Codeforces Round #324 (Div. 2)——B. Kolya and Tanya
- 多态实现线性表
- linux下编译C程序
- 第二章作业
- 【特种兵PPT教程】如何在PPT中插入单选按钮、复选框?
- Java的HashMap和HashTable
- ACM竞赛中数据结构题目心得:分块【With HDU4366】
- LeetCode: Game of Life
- Zabbix 监控之 - 报警篇 Actions