結果

問題 No.1521 Playing Musical Chairs Alone
ユーザー wolgnikwolgnik
提出日時 2021-05-28 22:32:20
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 504 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 81,536 KB
最終ジャッジ日時 2024-04-25 00:32:28
合計ジャッジ時間 21,092 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
57,216 KB
testcase_01 AC 178 ms
75,904 KB
testcase_02 AC 352 ms
76,288 KB
testcase_03 AC 45 ms
52,096 KB
testcase_04 AC 37 ms
51,840 KB
testcase_05 AC 1,662 ms
76,288 KB
testcase_06 AC 290 ms
76,160 KB
testcase_07 TLE -
testcase_08 AC 515 ms
76,288 KB
testcase_09 AC 784 ms
76,032 KB
testcase_10 AC 132 ms
76,160 KB
testcase_11 TLE -
testcase_12 AC 81 ms
76,032 KB
testcase_13 AC 176 ms
76,032 KB
testcase_14 AC 255 ms
76,160 KB
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N, K, L = map(int, input().split())
mod = 10 ** 9 + 7

dp = [0] * (N)
dp[0] = 1
for _ in range(K):
  imos = [0] * (N + L + 1)
  for i in range(N):
    imos[i + 1] += dp[i]
    imos[i + 1] %= mod
    imos[i + L + 1] -= dp[i]
    imos[i + L + 1] %= mod
  for i in range(N + L):
    imos[i + 1] += imos[i]
    imos[i + 1] %= mod
  for i in range(N + L + 1):
    if i < N: dp[i] = imos[i]
    else:
      dp[i % N] += imos[i]
      dp[i % N] %= mod
for r in dp: print(r)
0