# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
161504 | boolodifjenula | Preokret (COCI18_preokret) | Cpython 3 | 49 ms | 3468 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.
A=int(input())
As=[int(input()) for i in range (A)]
B=int(input())
k=0
Bs=[]
Ak=0
Bk=0
v1=5
c=0
for i in range (A+B):
if i<B:
Bs+=[int(input())]
if Bs[i-Bk]<=24*60:
k+=1
if i<A and As[i-Ak]<=24*60:
k+=1
if As and min(As[0],Bs[0]) in As:
Ak+=bool(As.pop(0))
elif Bs:
Bk+=bool(Bs.pop(0))
if Ak>Bk:
v=1
elif Bk>Ak:
v=0
if v!=v1:
c+=1
v1=v
print(k)
print(c-1)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |