結果
問題 | No.1011 Infinite Stairs |
ユーザー | toyuzuko |
提出日時 | 2020-03-30 23:39:00 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 627 bytes |
コンパイル時間 | 1,093 ms |
コンパイル使用メモリ | 86,848 KB |
実行使用メモリ | 76,336 KB |
最終ジャッジ日時 | 2023-09-05 11:23:44 |
合計ジャッジ時間 | 5,706 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
70,964 KB |
testcase_01 | AC | 73 ms
71,424 KB |
testcase_02 | AC | 283 ms
76,336 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
ソースコード
MOD = 10**9 + 7 N, D, K = map(int,input().split()) def power(base, exp, op=lambda x, y: x * y, ie=1): res = ie while exp: if exp & 1: res = op(res, base) base = op(base, base) exp >>= 1 return res def mul(f, g): h = [0 for _ in range(K + 1)] for i in range(K + 1): for j in range(K + 1): if i + j <= K: h[i + j] += f[i] * g[j] h[i + j] %= MOD return h ie = [0 for _ in range(K + 1)] ie[0] = 1 base = [0 for _ in range(K + 1)] for i in range(1, D + 1): base[i] = 1 print(power(base, N, mul, ie)[K])