This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |