112912024-08-04 10:18:13probaLudak Harcapython3Runtime error 0/10045ms14444 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 pos <= N - 1:
        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 error17ms2916 KiB
4Runtime error17ms2916 KiB
5Runtime error17ms2916 KiB
6Runtime error19ms3320 KiB
7Runtime error32ms4880 KiB
subtask30/40
8Runtime error17ms2916 KiB
9Runtime error18ms2968 KiB
10Runtime error20ms3856 KiB
11Runtime error23ms4392 KiB
12Runtime error28ms6012 KiB
13Runtime error35ms8060 KiB
14Runtime error39ms9460 KiB
15Runtime error41ms10600 KiB
subtask40/35
16Runtime error20ms3296 KiB
17Runtime error24ms4456 KiB
18Runtime error26ms6236 KiB
19Runtime error29ms7464 KiB
20Runtime error32ms6560 KiB
21Runtime error37ms9712 KiB
22Runtime error35ms11412 KiB
23Runtime error41ms11984 KiB
24Runtime error41ms9456 KiB
25Runtime error45ms14444 KiB