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 fast ios::sync_with_stdio(0);cin.tie(0);
typedef long long ll;
#define f first
#define s second
#define MAXN 100005
int last[9];
int main() {
memset(last, -1, sizeof(last));
fast
int n;
cin >> n;
int pnt1 = 0, pnt2 = 0;
for (int i = 0; i < n; i++) {
int t, a, b;
cin >> t >> a >> b;
if (last[a] != -1 && last[a] + 10 >= t) {
if (a <= 4) {
pnt1 += 150;
last[a] = t;
} else {
pnt2 += 150;
last[a] = t;
}
} else {
if (a <= 4) {
pnt1 += 100;
last[a] = t;
} else {
pnt2 += 100;
last[a] = t;
}
}
}
cout << pnt1 << " " << pnt2 << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |