結果

問題 No.1331 Moving Penguin
ユーザー titiatitia
提出日時 2021-01-08 22:22:13
言語 PyPy3
(7.3.13)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 532 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 86,876 KB
実行使用メモリ 353,876 KB
最終ジャッジ日時 2023-08-10 10:17:50
合計ジャッジ時間 62,955 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 187 ms
90,192 KB
testcase_01 AC 71 ms
75,652 KB
testcase_02 AC 75 ms
75,484 KB
testcase_03 AC 73 ms
75,484 KB
testcase_04 AC 1,433 ms
353,436 KB
testcase_05 AC 1,425 ms
353,644 KB
testcase_06 AC 1,435 ms
353,732 KB
testcase_07 AC 1,446 ms
353,472 KB
testcase_08 TLE -
testcase_09 TLE -
testcase_10 AC 1,406 ms
353,052 KB
testcase_11 AC 1,413 ms
353,136 KB
testcase_12 AC 1,431 ms
353,200 KB
testcase_13 AC 1,446 ms
353,508 KB
testcase_14 AC 1,421 ms
353,356 KB
testcase_15 AC 1,427 ms
353,384 KB
testcase_16 AC 1,422 ms
353,188 KB
testcase_17 AC 1,108 ms
352,964 KB
testcase_18 AC 1,180 ms
352,988 KB
testcase_19 AC 1,188 ms
352,968 KB
testcase_20 AC 1,153 ms
353,116 KB
testcase_21 AC 1,186 ms
352,968 KB
testcase_22 AC 1,159 ms
353,016 KB
testcase_23 AC 1,439 ms
353,072 KB
testcase_24 AC 1,466 ms
353,124 KB
testcase_25 AC 1,432 ms
353,052 KB
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 AC 1,425 ms
353,052 KB
testcase_30 AC 539 ms
171,512 KB
testcase_31 AC 949 ms
239,028 KB
testcase_32 AC 447 ms
159,808 KB
testcase_33 AC 620 ms
202,908 KB
testcase_34 AC 1,070 ms
262,272 KB
testcase_35 TLE -
testcase_36 TLE -
testcase_37 AC 1,493 ms
353,876 KB
testcase_38 AC 548 ms
176,304 KB
testcase_39 AC 1,356 ms
343,876 KB
testcase_40 AC 661 ms
219,156 KB
testcase_41 AC 1,420 ms
353,624 KB
testcase_42 AC 1,429 ms
353,820 KB
testcase_43 AC 1,459 ms
353,580 KB
testcase_44 AC 1,447 ms
353,692 KB
testcase_45 AC 1,426 ms
353,832 KB
testcase_46 AC 1,421 ms
353,692 KB
testcase_47 AC 1,435 ms
353,520 KB
testcase_48 AC 1,427 ms
353,416 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