Submission #496467

#TimeUsernameProblemLanguageResultExecution timeMemory
496467kappaLjeto (COCI21_ljeto)C++14
0 / 50
1 ms204 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...