Submission #496468

#TimeUsernameProblemLanguageResultExecution timeMemory
496468kappaLjeto (COCI21_ljeto)C++14
25 / 50
1 ms332 KiB
#include <bits/stdc++.h> using namespace std; int n, 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 && d[i - 1].time + 10 >= d[i].time && d[i - 1].from == d[i].from){ p1 += 50; } } else{ p2 += 100; if(d[i - 1].team == 2 && d[i - 1].time + 10 >= d[i].time && d[i - 1].from == d[i].from){ p2 += 50; } } } cout << p1 << " " << p2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...