您的位置:首页 > 其它

久违的月赛之二

2013-12-15 21:32 183 查看
1/http://acm.hust.edu.cn/vjudge/contest/view.action?cid=38706#problem/H

2、

H - 久违的月赛之二
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d
& %I64u
SubmitStatus

Description

好久没举办月赛了,这次lqw又给大家出了5道题,因为hsy学长宣传的很到位,吸引了n个DDMM们来做,另一位kk学长说,全做对的要给金奖,做对4题要给银奖,做对3题要给铜奖。统计数据的时候,发现每题分别在n个人中有n1、n2、n3、n4、n5个人通过,lqw问kk:“这次难度稍微提高了些,你再猜下,至少会有多少个人获奖?”

Input

第一行一个数字t,表示有多少组数据,每组数据如下所示(100< t < 300, 10<=n<=100, n1,...,n5<=n):

n

n1 n2 n3 n4 n5

Output

针对每组数据,输出一个数,表示最低获奖人数。

Sample Input

2
92
76 72 72 53 92
81
70 81 45 63 64


Sample Output

64
58


3、wrong代码:

#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
int t,n;
int a[8];
scanf("%d",&t);
while(t--)
{
int sum=0,minn=150;;
scanf("%d",&n);
for(int i=1;i<=5;i++)
{
scanf("%d",&a[i]);
sum+=a[i];
if(a[i]<minn)
minn=a[i];
}
int x=(sum-2*n+2*minn-5*minn)/2;
printf("%d\n",minn+x);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: