結果

問題 No.1331 Moving Penguin
ユーザー titiatitia
提出日時 2021-01-08 22:22:13
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 532 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 344,480 KB
最終ジャッジ日時 2024-04-28 03:42:45
合計ジャッジ時間 57,491 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 183 ms
90,752 KB
testcase_01 AC 45 ms
57,344 KB
testcase_02 AC 45 ms
57,600 KB
testcase_03 AC 45 ms
57,472 KB
testcase_04 AC 1,428 ms
343,916 KB
testcase_05 AC 1,425 ms
342,944 KB
testcase_06 AC 1,415 ms
342,816 KB
testcase_07 AC 1,442 ms
342,940 KB
testcase_08 AC 1,489 ms
342,528 KB
testcase_09 TLE -
testcase_10 AC 1,343 ms
342,384 KB
testcase_11 AC 1,362 ms
342,392 KB
testcase_12 AC 1,312 ms
342,480 KB
testcase_13 AC 1,303 ms
342,260 KB
testcase_14 AC 1,324 ms
342,268 KB
testcase_15 AC 1,393 ms
342,416 KB
testcase_16 AC 1,370 ms
342,140 KB
testcase_17 AC 1,087 ms
342,236 KB
testcase_18 AC 1,130 ms
342,352 KB
testcase_19 AC 1,122 ms
342,588 KB
testcase_20 AC 1,084 ms
342,360 KB
testcase_21 AC 1,106 ms
342,268 KB
testcase_22 AC 1,092 ms
342,628 KB
testcase_23 AC 1,353 ms
342,224 KB
testcase_24 AC 1,344 ms
342,228 KB
testcase_25 AC 1,329 ms
342,224 KB
testcase_26 AC 1,436 ms
343,848 KB
testcase_27 AC 1,430 ms
344,480 KB
testcase_28 AC 1,396 ms
343,752 KB
testcase_29 AC 1,341 ms
344,196 KB
testcase_30 AC 497 ms
166,752 KB
testcase_31 AC 884 ms
238,300 KB
testcase_32 AC 420 ms
154,552 KB
testcase_33 AC 597 ms
198,912 KB
testcase_34 AC 1,016 ms
251,128 KB
testcase_35 AC 1,401 ms
343,400 KB
testcase_36 AC 1,373 ms
343,660 KB
testcase_37 AC 1,383 ms
343,528 KB
testcase_38 AC 510 ms
171,632 KB
testcase_39 AC 1,300 ms
334,184 KB
testcase_40 AC 647 ms
217,680 KB
testcase_41 AC 1,314 ms
343,264 KB
testcase_42 AC 1,322 ms
343,408 KB
testcase_43 AC 1,318 ms
343,304 KB
testcase_44 AC 1,319 ms
343,556 KB
testcase_45 AC 1,352 ms
343,400 KB
testcase_46 AC 1,344 ms
343,524 KB
testcase_47 AC 1,350 ms
343,516 KB
testcase_48 AC 1,337 ms
342,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))
mod=10**9+7


DP=[[0]*(N+1) for i in range(351)]
DP[0][0]=1

for i in range(N):
    a=A[i]
    for j in range(1,351):
        if i-j>=0:
            DP[j][i]+=DP[j][i-j]
            DP[j][i]%=mod

            DP[0][i]+=DP[j][i]
            DP[0][i]%=mod
            
    if a>350:
        for j in range(i+a,N,a):
            DP[0][j]+=DP[0][i]

    else:
        DP[a][i]+=DP[0][i]

    if a!=1:
        DP[0][i+1]+=DP[0][i]

print(DP[0][N-1])
0