23522023-01-10 22:42:02kristofLudak Harcapython3Accepted 100/100103ms36364 KiB
N = int(input())

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

placeNow = 0
steps = 0

for i in range(1, 7):
    placeNow = 0
    steps = 0
    while placeNow < N:
        steps += 1
        placeNow += i
        try:
            while table[placeNow] != 0:
                placeNow += table[placeNow]
        except:
            break
        
    print(steps, end=" ")
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms10868 KiB
2Accepted17ms11252 KiB
subtask225/25
3Accepted16ms11248 KiB
4Accepted16ms11596 KiB
5Accepted17ms11740 KiB
6Accepted25ms12064 KiB
7Accepted103ms15700 KiB
subtask340/40
8Accepted17ms12092 KiB
9Accepted17ms12648 KiB
10Accepted19ms14124 KiB
11Accepted21ms15400 KiB
12Accepted27ms18440 KiB
13Accepted32ms22744 KiB
14Accepted39ms26028 KiB
15Accepted43ms27924 KiB
subtask435/35
16Accepted29ms13672 KiB
17Accepted21ms16212 KiB
18Accepted25ms19444 KiB
19Accepted27ms21856 KiB
20Accepted29ms20620 KiB
21Accepted34ms26844 KiB
22Accepted37ms29832 KiB
23Accepted39ms31412 KiB
24Accepted39ms26404 KiB
25Accepted43ms36364 KiB