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;
typedef long long ll;
int main() {
int n; cin>>n;
ll prev=-1;
int prev_p[2];
fill(prev_p,prev_p+2,0);
ll pi=0;
ll bl=0;
while (n--) {
ll t, a,b; cin>>t>>a>>b;
if (prev==-1) {
prev=t;
if (a<=4) {
prev_p[0]=a;
pi+=100;
}
else {
prev_p[1]=a;
bl+=100;
}
} else {
if (t-prev<=10) {
prev=t;
if (a<=4) {
if (prev_p[0]==a) pi+=150;
else {
prev_p[0]=a;
pi+=100;
}
}
else {
if (prev_p[1]==a) bl+=150;
else {
prev_p[1]=a;
bl+=100;
}
}
} else {
prev=t;
if (a<=4) {
prev_p[0]=a;
pi+=100;
}
else {
prev_p[1]=a;
bl+=100;
}
}
}
}
cout<<pi<<" "<<bl;
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... |