結果
| 問題 |
No.1011 Infinite Stairs
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2020-03-20 21:46:10 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 554 bytes |
| コンパイル時間 | 125 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 24,408 KB |
| 最終ジャッジ日時 | 2024-12-15 05:12:37 |
| 合計ジャッジ時間 | 38,568 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 TLE * 10 |
ソースコード
# 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