結果

問題 No.1331 Moving Penguin
ユーザー penguinmanpenguinman
提出日時 2020-10-15 02:25:22
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 581 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 92,544 KB
最終ジャッジ日時 2024-04-19 19:35:48
合計ジャッジ時間 62,188 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
70,272 KB
testcase_01 AC 41 ms
52,224 KB
testcase_02 AC 40 ms
52,096 KB
testcase_03 AC 39 ms
52,096 KB
testcase_04 AC 1,203 ms
92,416 KB
testcase_05 AC 1,486 ms
91,520 KB
testcase_06 TLE -
testcase_07 TLE -
testcase_08 AC 1,320 ms
90,880 KB
testcase_09 AC 1,314 ms
90,880 KB
testcase_10 AC 1,238 ms
91,392 KB
testcase_11 AC 1,257 ms
91,136 KB
testcase_12 AC 1,334 ms
91,136 KB
testcase_13 AC 1,293 ms
91,136 KB
testcase_14 AC 1,250 ms
91,264 KB
testcase_15 AC 1,247 ms
91,136 KB
testcase_16 AC 1,287 ms
91,136 KB
testcase_17 AC 1,259 ms
88,192 KB
testcase_18 AC 1,271 ms
88,192 KB
testcase_19 AC 1,229 ms
88,576 KB
testcase_20 AC 1,253 ms
91,264 KB
testcase_21 AC 1,286 ms
91,392 KB
testcase_22 AC 1,266 ms
91,008 KB
testcase_23 AC 1,291 ms
91,136 KB
testcase_24 AC 1,314 ms
91,008 KB
testcase_25 AC 1,348 ms
91,264 KB
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 AC 1,233 ms
90,240 KB
testcase_30 AC 377 ms
80,512 KB
testcase_31 AC 734 ms
84,096 KB
testcase_32 AC 331 ms
79,616 KB
testcase_33 AC 528 ms
82,432 KB
testcase_34 AC 877 ms
86,656 KB
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 AC 396 ms
80,256 KB
testcase_39 AC 1,438 ms
92,160 KB
testcase_40 AC 605 ms
83,712 KB
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
testcase_48 AC 1,215 ms
88,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N=int(input())
mod=1e9+7
A=list(map(int,input().split()))
dp=[0]*N
dp[0]=1
M=int(math.sqrt(N))
Sum=[[0]*(M+1) for i in range(M+1)]
for i in range(N):
    if i>0 and A[i-1]!=1:
        dp[i]+=dp[i-1];
        dp[i]%=mod
    for j in range(M+1):
        if j>0:
            dp[i]+=Sum[j][i%j]
            dp[i]%=mod
    if A[i]<=M:
        Sum[A[i]][i%A[i]]+=dp[i]
        Sum[A[i]][i%A[i]]%=mod
    else:
        for j in range(N):
            X=j*A[i]+A[i]+i
            if X>=N:
                break
            dp[X]+=dp[i]
            dp[X]%=mod
print(int(dp[N-1]))
0