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 |
3428 KB |
Output is correct |
2 |
Correct |
26 ms |
3432 KB |
Output is correct |
3 |
Correct |
26 ms |
3300 KB |
Output is correct |
4 |
Correct |
27 ms |
3300 KB |
Output is correct |
5 |
Correct |
29 ms |
3428 KB |
Output is correct |
6 |
Runtime error |
33 ms |
3340 KB |
Execution failed because the return code was nonzero |
7 |
Runtime error |
43 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 |
51 ms |
3360 KB |
Output is correct |
10 |
Correct |
26 ms |
3356 KB |
Output is correct |