제출 #974287

#제출 시각아이디문제언어결과실행 시간메모리
974287vjudge1Ljeto (COCI21_ljeto)C++17
0 / 50
1 ms504 KiB
#include <bits/stdc++.h> using namespace std; #define pii pair<int, int> #define time first #define ai second.first #define bi second.second int main() { int n; cin >> n; vector<pair<int, pii>> l (n); for(int i = 0; i < n; i++) { cin >> l[i].time >> l[i].ai >> l[i].bi; } int le = 0, ri = 0, e = 0, b = 0; bool found = false; if (n == 1) { if (l[ri].ai > 4) { b += 100; } else { e += 100; } cout << e << " " << b; return 0; } while (ri < n) { if (le == ri) { ri++; if (l[ri].ai > 4) { b += 100; } else { e += 100; } } if (l[ri].time - l[le].time <= 10) { for (int i = 1; i <= ri - le; i++) { if (l[ri].ai == l[ri-i].ai) { if (l[ri].ai > 4) { b += 150; found = true; break; } else { e += 150; found = true; break; } } } if (found == false) { if (l[ri].ai > 4) { b += 100; } else { e += 100; } } } else { le++; continue; } found = false; ri++; } cout << e << " " << b; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...