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()))
if As_Bs[i].count(0):
As_Bs[i].remove(0)# убираю все нули
s = As_Bs[0] + As_Bs[1]
s.sort()
grade = 0
for i in range(len(s)):
if s[i] > 1440:
break
grade += 1
progress = 0
for i in range(len(s)):
if i == 0 and As_Bs[0].count(s[i]):
w = 'B'
elif i == 0 and As_Bs[1].count(s[i]):
w = 'A' # не позволяет увеличивать progress на 1, так как не имеет значение строки
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 |
Partially correct |
10 ms |
2908 KB |
Output is partially correct |
2 |
Partially correct |
10 ms |
2908 KB |
Output is partially correct |
3 |
Partially correct |
10 ms |
3012 KB |
Output is partially correct |
4 |
Partially correct |
11 ms |
2908 KB |
Output is partially correct |
5 |
Partially correct |
13 ms |
3064 KB |
Output is partially correct |
6 |
Partially correct |
20 ms |
2908 KB |
Output is partially correct |
7 |
Partially correct |
47 ms |
3088 KB |
Output is partially correct |
8 |
Partially correct |
48 ms |
3112 KB |
Output is partially correct |
9 |
Partially correct |
64 ms |
2908 KB |
Output is partially correct |
10 |
Partially correct |
11 ms |
2908 KB |
Output is partially correct |