27422023-01-20 15:21:32kristofSzemetessorpython3Wrong answer 0/100569ms63940 KiB
N, M = input().split()
N = int(N)
M = int(M)

avo = 0

lista = [0 for i in range(N)]

MaxErtekLista = list(map(int, input().split()))

for i in range(M):
    index, value = input().split()
    index = int(index)
    value = int(value)

    lista[index] += value

for i in range(N):
    avo += MaxErtekLista[i] - lista[i] % MaxErtekLista[i] 

print(avo)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11224 KiB
2Accepted17ms11440 KiB
subtask20/17
3Wrong answer17ms11912 KiB
4Accepted17ms12308 KiB
5Accepted17ms12132 KiB
6Wrong answer16ms12292 KiB
7Accepted17ms12572 KiB
8Accepted17ms12352 KiB
9Wrong answer17ms12520 KiB
10Accepted17ms12556 KiB
11Wrong answer17ms12604 KiB
subtask30/25
12Wrong answer352ms13112 KiB
13Wrong answer363ms13176 KiB
14Wrong answer379ms13536 KiB
15Wrong answer377ms14096 KiB
16Wrong answer386ms15900 KiB
17Wrong answer453ms37352 KiB
18Accepted549ms61192 KiB
19Accepted551ms61316 KiB
20Accepted559ms61364 KiB
subtask40/20
21Wrong answer370ms16340 KiB
22Wrong answer400ms26204 KiB
23Wrong answer384ms16248 KiB
24Wrong answer398ms19692 KiB
25Wrong answer381ms16244 KiB
26Wrong answer465ms37584 KiB
27Wrong answer532ms59396 KiB
28Wrong answer551ms60324 KiB
29Wrong answer536ms60512 KiB
30Wrong answer541ms63940 KiB
subtask50/38
31Wrong answer17ms13920 KiB
32Wrong answer16ms13948 KiB
33Wrong answer17ms14228 KiB
34Wrong answer17ms14236 KiB
35Wrong answer41ms16528 KiB
36Wrong answer372ms14448 KiB
37Wrong answer541ms61896 KiB
38Wrong answer535ms62144 KiB
39Wrong answer550ms62044 KiB
40Wrong answer560ms61964 KiB
41Wrong answer547ms62136 KiB
42Wrong answer569ms61888 KiB