結果
| 問題 |
No.1331 Moving Penguin
|
| コンテスト | |
| ユーザー |
Kiri8128
|
| 提出日時 | 2021-01-08 21:58:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 540 bytes |
| コンパイル時間 | 1,195 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 1,693,784 KB |
| 最終ジャッジ日時 | 2024-11-16 11:29:49 |
| 合計ジャッジ時間 | 54,328 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 12 TLE * 13 MLE * 9 |
ソースコード
P = 10 ** 9 + 7
N = int(input())
A = [int(a) for a in input().split()]
X = [0] * N
X[0] = 1
K = 3
Y = [[0] * a for a in range(K)]
for i, a in enumerate(A):
s = X[i] + X[i-1]
if s >= P: s -= P
for j in range(1, K):
s += Y[j][a%j]
if s >= P: s -= P
X[i] = s
if a < K:
Y[a][i%a] += s
if a == 1 and i < N - 1:
X[i+1] -= s
else:
for j in range(i + a, N, a):
X[j] += s
if X[j] >= P: X[j] -= P
# print("Y =", Y)
print(X[-1])
# print("X =", X)
Kiri8128