89262024-02-05 17:10:42NagyLeoSzínes szobák (50 pont)python3Wrong answer 0/50400ms19644 KiB
def main():
    N, K, M = map(int, input().split())
    rooms_raw = list(map(int, input().split()))
    rooms = []

    for i in rooms_raw:
        rooms.append([i, 1])

    left_people = 0
    for i in range(M):
        color, direct = map(int, input().split())

        for j in range(N):
            if rooms[j][0] == color:
                if j + direct > N - 1 or j + direct < 0:
                    left_people += rooms[j][1]
                    rooms[j][1] = 0
                else:
                    rooms[j + direct][1] += rooms[j][1]
                    rooms[j][1] = 0


main()
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/018ms11392 KiB
2Time limit exceeded0/0361ms16996 KiB
3Wrong answer0/1229ms12072 KiB
4Wrong answer0/1234ms12392 KiB
5Wrong answer0/1226ms12408 KiB
6Wrong answer0/1228ms12356 KiB
7Wrong answer0/1230ms12384 KiB
8Wrong answer0/1224ms12328 KiB
9Wrong answer0/1224ms12276 KiB
10Time limit exceeded0/1365ms5332 KiB
11Wrong answer0/1225ms12812 KiB
12Time limit exceeded0/1344ms5520 KiB
13Time limit exceeded0/1367ms5980 KiB
14Time limit exceeded0/1360ms6368 KiB
15Time limit exceeded0/1358ms6728 KiB
16Time limit exceeded0/1379ms7104 KiB
17Time limit exceeded0/1367ms7068 KiB
18Time limit exceeded0/1351ms7108 KiB
19Time limit exceeded0/1388ms19136 KiB
20Time limit exceeded0/1360ms19224 KiB
21Time limit exceeded0/1372ms19204 KiB
22Time limit exceeded0/1368ms19180 KiB
23Time limit exceeded0/1363ms19232 KiB
24Time limit exceeded0/1372ms19360 KiB
25Time limit exceeded0/1372ms19184 KiB
26Time limit exceeded0/1375ms19644 KiB
27Time limit exceeded0/3365ms18116 KiB
28Time limit exceeded0/3365ms18148 KiB
29Time limit exceeded0/3375ms18028 KiB
30Time limit exceeded0/3375ms18076 KiB
31Time limit exceeded0/3379ms17964 KiB
32Time limit exceeded0/3400ms17908 KiB
33Time limit exceeded0/4375ms12356 KiB
34Time limit exceeded0/4356ms12464 KiB