112922024-08-04 10:19:26probaLudak Harcapython3Runtime error 0/10046ms14392 KiB
N, kapu, dobasok = int(input()), list(map(int, input().split(' '))), []
#N, kapu, dobasok = 7, list(map(int, '0 7 0 2 0 1 0'.split(' '))), []


for i in range(1, 7):
    pos, lepes = 0, 0
    while N > pos:
        if kapu[pos] == 0:
            pos += i
            lepes += 1
        else:
            pos += kapu[pos]
    dobasok += [str(lepes)]
    
print(' '.join(dobasok))

SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms2916 KiB
2Accepted17ms2916 KiB
subtask20/25
3Runtime error18ms2912 KiB
4Runtime error17ms2916 KiB
5Runtime error17ms3064 KiB
6Runtime error18ms3172 KiB
7Runtime error32ms4880 KiB
subtask30/40
8Runtime error18ms2916 KiB
9Runtime error18ms3440 KiB
10Runtime error21ms3952 KiB
11Runtime error21ms4392 KiB
12Runtime error28ms5844 KiB
13Runtime error37ms8040 KiB
14Runtime error41ms9564 KiB
15Runtime error45ms10604 KiB
subtask40/35
16Runtime error20ms3364 KiB
17Runtime error23ms4308 KiB
18Runtime error25ms6508 KiB
19Runtime error28ms7596 KiB
20Runtime error29ms6560 KiB
21Runtime error32ms9664 KiB
22Runtime error37ms11316 KiB
23Runtime error39ms12116 KiB
24Runtime error39ms9460 KiB
25Runtime error46ms14392 KiB