117912024-11-10 19:32:55MLudak Harcapython3Accepted 100/100104ms13852 KiB
from sys import stdin, stdout

N = int(input(""))
J = list(map(int, stdin.readline().split()))

position = 0
step = 0
rolls = []

for i in range(1, 7):
    while position < N:
        position += i
        step += 1
        try:
            while J[position] != 0:
                position += J[position]
        except:
            break
    print(step, end=" ")
    step = 0
    position = 0
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3120 KiB
2Accepted16ms3116 KiB
subtask225/25
3Accepted16ms3128 KiB
4Accepted16ms2872 KiB
5Accepted17ms3128 KiB
6Accepted26ms3128 KiB
7Accepted104ms4904 KiB
subtask340/40
8Accepted17ms3128 KiB
9Accepted17ms3112 KiB
10Accepted18ms3780 KiB
11Accepted21ms4476 KiB
12Accepted26ms5800 KiB
13Accepted35ms8088 KiB
14Accepted41ms9472 KiB
15Accepted43ms10176 KiB
subtask435/35
16Accepted29ms3384 KiB
17Accepted20ms4356 KiB
18Accepted25ms6160 KiB
19Accepted28ms7228 KiB
20Accepted30ms6516 KiB
21Accepted34ms9828 KiB
22Accepted37ms10916 KiB
23Accepted41ms11944 KiB
24Accepted41ms9400 KiB
25Accepted48ms13852 KiB