记录编号 |
164141 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[NOIP 2005]谁拿了最多奖学金 |
最终得分 |
100 |
用户昵称 |
啊吧啦吧啦吧 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.005 s |
提交时间 |
2015-05-28 17:57:04 |
内存使用 |
0.32 MiB |
显示代码纯文本
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cstring>
using namespace std;
const int MAXN = 101;
struct node{
string name;
int qm, py, lw, jj;
bool gb, xb;
}student[MAXN];
int n;
int main()
{
freopen("scholar.in", "r", stdin);
freopen("scholar.out", "w", stdout);
char a, b;
scanf ("%d", &n);
for (int i = 1; i <= n; i ++)
{
cin >> student[i].name >> student[i].qm >> student[i].py >> a >> b >> student[i].lw;
student[i].gb = a == 'Y' ? 1 : 0;
student[i].xb = b == 'Y' ? 1 : 0;
student[i].jj = 0;
}
for (int i = 1; i <= n; i ++)
{
if (student[i].qm > 80 && student[i].lw >= 1)
student[i].jj += 8000;
if (student[i].qm > 85 && student[i].py > 80)
student[i].jj += 4000;
if (student[i].qm > 90)
student[i].jj += 2000;
if (student[i].qm > 85 && student[i].xb)
student[i].jj += 1000;
if (student[i].py > 80 && student[i].gb)
student[i].jj += 850;
}
int jl, maxx = -0x7ffffffe, tot = 0;
for (int i = n; i > 0; i --)
{
if (student[i].jj >= maxx)
{
maxx = student[i].jj;
jl = i;
}
tot += student[i].jj;
}
cout << student[jl].name << endl << maxx << endl << tot << endl;
fclose(stdin);
fclose(stdout);
return 0;
}