# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156686 | dcj | Preokret (COCI18_preokret) | C++14 | 3 ms | 380 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 Ap[2880] , Bp[2880];
int A, B, s, pv=0, P=0, x=0;
cin >> A;
for (int i=1;i<=A;i++) {
cin >> s;
if (s<=1440)
pv++;
Ap[s-1]=1;
}
cin >> B;
for (int i=1;i<=B;i++) {
cin >> s;
if (s<=1440)
pv++;
Bp[s-1]=1;
}
cout << pv << "\n";
for (int i=0;i<=2879;i++) {
if (Ap[i]==1)
A--;
if (Bp[i] ==1)
B--;
if (A<B and x==2)
P++;
x=1;
if (B<A and x==1)
P++;
x=2;
}
cout << P;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |