Submission #162012

#TimeUsernameProblemLanguageResultExecution timeMemory
162012ToniBPreokret (COCI18_preokret)C++14
50 / 50
4 ms376 KiB
#include <iostream> using namespace std; int main(){ int a, As, b, Bs, sol1 = 0, sol2 = 0, score1 = 0, score2 = 0; int winner = 0, pastwinner = 0; cin >> a; int Al[2880]; int Bl[2880]; for(int i = 0; i < 2880; i++){ Al[i] = 0; Bl[i] = 0; } for(int i = 0; i < a; i++){ cin >> As; if(As <= 1440){ sol1 += 1; } Al[As] = 1; } cin >> b; for(int i = 0; i < b; i++){ cin >> Bs; if(Bs <= 1440){ sol1 += 1; } Bl[Bs] = 1; } for(int i = 0; i < 2880; i++){ if(Al[i] == 1){ score1 += 1; } if(Bl[i] == 1){ score2 += 1; } pastwinner = winner; if(score1 < score2){ winner = 2; } if(score2 < score1){ winner = 1; } if(winner != pastwinner){ sol2 += 1; } } cout << sol1 << endl;; cout << sol2 - 1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...