Submission #920425

#TimeUsernameProblemLanguageResultExecution timeMemory
920425SuPythonyLjeto (COCI21_ljeto)C++17
25 / 50
1 ms348 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...