# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
162012 | ToniB | Preokret (COCI18_preokret) | C++14 | 4 ms | 376 KiB |
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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |