http://codeforces.com/contest/1017/problem/A
题意:每个人有4门学科,给出n个人的分数,小明的分数是第一个给出的,问小明的总分排名第几
思路:水题,求和排序即可。
#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
int n, a, b, c, d, sum, p, ct = 0;
int i;
scanf("%d", &n);
scanf("%d%d%d%d", &a, &b, &c, &d);
p = a + b + c + d;
for (i = 2; i <= n; i++)
{
scanf("%d%d%d%d", &a, &b, &c, &d);
sum = a + b + c + d;
if (sum > p)
{
ct++;
}
}
printf("%d\n", ct + 1);
return 0;
}