From 8f47176ac37f32535bf5871e6cd9f0dae09fd414 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sat, 2 Oct 2021 17:24:19 +0800 Subject: [PATCH] =?UTF-8?q?P1001=20=E8=B0=81=E6=8B=BF=E4=BA=86=E6=9C=80?= =?UTF-8?q?=E5=A4=9A=E5=A5=96=E5=AD=A6=E9=87=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://vijos.org/records/6158253bf4136204419963a0 --- Vijos/1001/1001.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Vijos/1001/1001.cpp diff --git a/Vijos/1001/1001.cpp b/Vijos/1001/1001.cpp new file mode 100644 index 00000000..5c4d1d52 --- /dev/null +++ b/Vijos/1001/1001.cpp @@ -0,0 +1,39 @@ +#include + +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; +}