0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 18:08:47 +00:00

P1001 谁拿了最多奖学金

https://vijos.org/records/6158253bf4136204419963a0
This commit is contained in:
Baoshuo Ren 2021-10-02 17:24:19 +08:00 committed by Baoshuo Ren
parent 378abf1efc
commit 8f47176ac3
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

39
Vijos/1001/1001.cpp Normal file
View 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;
}