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;
const int maxn = 1e3+3;
bool check(int x) {
if(x<=4) return 1; else return 0;
}
int main() {
int n;
cin >> n;
int tima=0, timb=0;
int t,a,b;
vector<pair<int,int>>urut;
urut.resize(n);
for(int i=0; i<n; i++) {
cin >> t >> a >> b;
if(check(a)) {
tima+=100;
} else {
timb+=100;
}
urut[i] = {a, t};
}
sort(urut.begin(), urut.end());
for(int i=1; i<n; i++) {
if(urut[i].second - urut[i-1].second <= 10 && urut[i].first == urut[i-1].first) {
if(check(urut[i].first)) {
tima+=50;
} else {
timb+=50;
}
}
}
cout << tima << " " << timb << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |