mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 12:58:48 +00:00
P1051 [NOIP2005 提高组] 谁拿了最多奖学金
R58931225
This commit is contained in:
parent
8f47176ac3
commit
52d09159cf
39
Luogu/problem/P1051/P1051.cpp
Normal file
39
Luogu/problem/P1051/P1051.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int n, s1, s2, sum = 0, maxq = 0, tot = 0, x, i;
|
||||
char a, b;
|
||||
string name, maxn;
|
||||
|
||||
int main() {
|
||||
cin >> n;
|
||||
for (i = 1; i <= n; i++) {
|
||||
cin >> name >> s1 >> s2 >> a >> b >> x;
|
||||
if (s1 > 80 && x > 0) {
|
||||
sum += 8000;
|
||||
}
|
||||
if (s1 > 85 && s2 > 80) {
|
||||
sum += 4000;
|
||||
}
|
||||
if (s1 > 90) {
|
||||
sum += 2000;
|
||||
}
|
||||
if (s1 > 85 && b == 'Y') {
|
||||
sum += 1000;
|
||||
}
|
||||
if (s2 > 80 && a == 'Y') {
|
||||
sum += 850;
|
||||
}
|
||||
tot += sum;
|
||||
if (sum > maxq) {
|
||||
maxn = name;
|
||||
maxq = sum;
|
||||
}
|
||||
sum = 0;
|
||||
}
|
||||
cout << maxn << endl
|
||||
<< maxq << endl
|
||||
<< tot << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user