結果

問題 No.1331 Moving Penguin
ユーザー marroncastlemarroncastle
提出日時 2021-01-20 21:13:06
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 530 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 91,648 KB
最終ジャッジ日時 2024-06-06 02:11:54
合計ジャッジ時間 10,390 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 37 ms
52,352 KB
testcase_02 AC 37 ms
52,096 KB
testcase_03 AC 37 ms
52,352 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 176 ms
85,376 KB
testcase_09 AC 177 ms
85,504 KB
testcase_10 AC 179 ms
85,376 KB
testcase_11 AC 179 ms
85,504 KB
testcase_12 AC 175 ms
85,760 KB
testcase_13 AC 174 ms
85,632 KB
testcase_14 AC 174 ms
85,760 KB
testcase_15 AC 174 ms
85,632 KB
testcase_16 AC 176 ms
85,504 KB
testcase_17 AC 173 ms
84,992 KB
testcase_18 AC 172 ms
84,864 KB
testcase_19 AC 173 ms
84,608 KB
testcase_20 AC 172 ms
84,608 KB
testcase_21 AC 172 ms
84,992 KB
testcase_22 AC 171 ms
84,608 KB
testcase_23 AC 175 ms
85,632 KB
testcase_24 AC 175 ms
85,632 KB
testcase_25 AC 176 ms
85,504 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 175 ms
87,296 KB
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 245 ms
89,760 KB
testcase_36 AC 247 ms
89,984 KB
testcase_37 AC 244 ms
89,944 KB
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 AC 243 ms
89,848 KB
testcase_43 AC 243 ms
89,728 KB
testcase_44 AC 240 ms
89,728 KB
testcase_45 AC 240 ms
89,856 KB
testcase_46 AC 238 ms
89,728 KB
testcase_47 AC 243 ms
89,808 KB
testcase_48 AC 174 ms
84,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,os,io
input = sys.stdin.readline
#input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
N = int(input())
A = list(map(int, input().split()))
n = int(N**.5)+1
cum = [[0]*(51) for _ in range(51)]
dp = [0]*N
dp[-1] = 1
MOD = 10**9+7
for i in range(N-1,-1,-1):
  if A[i]>1 and i<N-1:
    dp[i] += dp[i+1]
  if A[i]>100:
    for j in range(i+A[i],N,A[i]):
      dp[i] += dp[j]
  else:
    dp[i] += cum[A[i]][i%A[i]]
  dp[i] %= MOD
  for k in range(1,51):
    cum[k][i%k] += dp[i]
    cum[k][i%k] %= MOD
print(dp[0])
  
0