Submission #1065709

# Submission time Handle Problem Language Result Execution time Memory
1065709 2024-08-19T11:09:23 Z Energi Preokret (COCI18_preokret) Python 3
40 / 50
49 ms 3164 KB
As_Bs = [[], []]

ballAB = [0, 0] 

for i in range(len(As_Bs)):
    A_B = int(input())
    for time in range(A_B):
        As_Bs[i].append(int(input()))

s = As_Bs[0] + As_Bs[1]
s.sort()

for i in range(len(s)):
    if s[i] > 1440:
        grade = len(s[:i])
        break

progress = 0
for i in range(len(s)):
    if i == 0 and As_Bs[0].count(s[i]):
        w = 'A'
    elif i == 0 and As_Bs[1].count(s[i]):
        w = 'B'
    if As_Bs[0].count(s[i]):# if s[i] in As_Bs[0]:
        ballAB[0] += 1
    elif As_Bs[1].count(s[i]):
        ballAB[1] += 1
    if ballAB[1] != 0 and ballAB[0] > ballAB[1] and w == 'B':
        progress += 1
        w = 'A'
    elif ballAB[0] != 0 and ballAB[1] > ballAB[0] and w == 'A':
        progress += 1
        w = 'B'
print(grade, progress, sep= '\n')
# Verdict Execution time Memory Grader output
1 Runtime error 11 ms 3160 KB Execution failed because the return code was nonzero
2 Runtime error 11 ms 2908 KB Execution failed because the return code was nonzero
3 Correct 11 ms 2996 KB Output is correct
4 Correct 13 ms 2980 KB Output is correct
5 Correct 13 ms 2892 KB Output is correct
6 Correct 18 ms 3032 KB Output is correct
7 Correct 36 ms 2908 KB Output is correct
8 Correct 40 ms 2908 KB Output is correct
9 Correct 49 ms 3164 KB Output is correct
10 Correct 11 ms 2908 KB Output is correct