結果
| 問題 | No.1011 Infinite Stairs |
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2020-03-20 21:46:10 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 554 bytes |
| 記録 | |
| コンパイル時間 | 551 ms |
| コンパイル使用メモリ | 20,956 KB |
| 実行使用メモリ | 24,320 KB |
| 最終ジャッジ日時 | 2026-05-25 18:35:22 |
| 合計ジャッジ時間 | 4,872 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 23 |
ソースコード
# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read
n,d,k = [int(i) for i in read().split()]
MOD = 10**9+7
def mul(c,m,dp): #multiply (1-x^c) up to x^m
for i in range(m,c-1,-1):
dp[i] -= dp[i-c]
dp[i] %= MOD
def div(c,m,dp): #divide by (1-x^c) up to x^m
for i in range(m-c+1):
dp[i+c] += dp[i]
dp[i+c] %= MOD
L = n*d
f = [1]+[0]*L
for _ in range(n):
mul(d,L,f)
for _ in range(n):
div(1,L,f)
#print(dp)
print(f[k-n]%MOD)
convexineq