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;
int n, ltime = -15, p1, p2;
struct event{
int time, from, to, team;
};
event d[105];
int main(){
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> d[i].time >> d[i].from >> d[i].to;
if(d[i].from <= 4){
d[i].team = 1;
}else{
d[i].team = 2;
}
}
for (int i = 0; i < n; i++)
{
if(d[i].team == 1){
p1 += 100;
if(d[i - 1].team == 1 && ltime + 10 <= d[i].time && d[i - 1].from == d[i].from){
p1 += 50;
ltime = d[i].time;
}
}
else{
p2 += 100;
if(d[i - 1].team == 2 && ltime + 10 <= d[i].time && d[i - 1].from == d[i].from){
p2 += 50;
ltime = d[i].time;
}
}
}
cout << p1 << " " << p2;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |