結果

問題 No.1331 Moving Penguin
ユーザー convexineqconvexineq
提出日時 2021-01-08 23:22:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 94,968 KB
最終ジャッジ日時 2024-04-28 05:39:31
合計ジャッジ時間 48,826 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
66,816 KB
testcase_01 AC 44 ms
59,008 KB
testcase_02 AC 47 ms
58,880 KB
testcase_03 AC 48 ms
59,008 KB
testcase_04 WA -
testcase_05 AC 1,094 ms
90,368 KB
testcase_06 AC 1,102 ms
90,584 KB
testcase_07 AC 1,119 ms
90,240 KB
testcase_08 AC 1,130 ms
92,672 KB
testcase_09 AC 1,132 ms
92,672 KB
testcase_10 AC 1,105 ms
89,856 KB
testcase_11 AC 1,113 ms
90,004 KB
testcase_12 AC 1,129 ms
92,416 KB
testcase_13 AC 1,099 ms
89,728 KB
testcase_14 AC 1,089 ms
90,240 KB
testcase_15 AC 1,089 ms
89,952 KB
testcase_16 AC 1,110 ms
90,112 KB
testcase_17 AC 1,078 ms
92,800 KB
testcase_18 AC 1,085 ms
92,416 KB
testcase_19 AC 1,092 ms
92,544 KB
testcase_20 AC 1,133 ms
92,800 KB
testcase_21 AC 1,120 ms
92,800 KB
testcase_22 AC 1,139 ms
92,672 KB
testcase_23 AC 1,099 ms
89,472 KB
testcase_24 AC 1,128 ms
89,728 KB
testcase_25 AC 1,123 ms
89,472 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1,113 ms
94,080 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 383 ms
74,624 KB
testcase_33 WA -
testcase_34 AC 779 ms
87,680 KB
testcase_35 AC 1,095 ms
90,368 KB
testcase_36 AC 1,087 ms
90,240 KB
testcase_37 AC 1,094 ms
90,496 KB
testcase_38 AC 430 ms
76,288 KB
testcase_39 AC 1,087 ms
93,696 KB
testcase_40 WA -
testcase_41 AC 1,124 ms
93,056 KB
testcase_42 AC 1,137 ms
93,056 KB
testcase_43 AC 1,107 ms
90,368 KB
testcase_44 AC 1,097 ms
90,112 KB
testcase_45 AC 1,091 ms
90,112 KB
testcase_46 AC 1,100 ms
90,340 KB
testcase_47 AC 1,100 ms
90,240 KB
testcase_48 AC 1,095 ms
89,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
M = 512
MOD = 10**9+7
laz = [[0]*i for i in range(M+1)]
dp = [0]*(n+1)
dp[0] = 1
for i in range(n):
    for j in range(1,M):
        dp[i] += laz[j][i%j]
    dp[i] %= MOD
    ai = a[i]
    if ai > M:
        for k in range(i+ai,n+1,ai):
            dp[k] += dp[i]
    else:
        laz[ai][i%ai] += dp[i]
    if ai != 1:
        dp[i+1] += dp[i]
print(dp[n-1])
0