結果

問題 No.1011 Infinite Stairs
コンテスト
ユーザー maspy
提出日時 2020-03-20 23:47:36
言語 Python3
(3.14.2 + numpy 2.4.0 + scipy 1.16.3)
結果
AC  
実行時間 1,002 ms / 2,000 ms
コード長 351 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 107 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 81,208 KB
最終ジャッジ日時 2024-07-17 11:54:54
合計ジャッジ時間 22,602 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
MOD = 10**9 + 7

N, D, K = map(int, read().split())
K -= N
dp = np.zeros(D * N, np.int64)
dp[0] = 1
for _ in range(N):
    dp[D:] -= dp[:-D]
    np.cumsum(dp, out=dp)
    dp %= MOD
print(dp[K])
0