Submission #161504

# Submission time Handle Problem Language Result Execution time Memory
161504 2019-11-02T17:43:09 Z boolodifjenula Preokret (COCI18_preokret) Python 3
35 / 50
49 ms 3468 KB
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
1 Correct 26 ms 3300 KB Output is correct
2 Correct 28 ms 3300 KB Output is correct
3 Correct 26 ms 3360 KB Output is correct
4 Correct 27 ms 3340 KB Output is correct
5 Correct 34 ms 3340 KB Output is correct
6 Runtime error 32 ms 3468 KB Execution failed because the return code was nonzero
7 Runtime error 44 ms 3344 KB Execution failed because the return code was nonzero
8 Runtime error 43 ms 3344 KB Execution failed because the return code was nonzero
9 Correct 49 ms 3380 KB Output is correct
10 Correct 26 ms 3360 KB Output is correct