結果
問題 | No.269 見栄っ張りの募金活動 |
ユーザー | tassei903 |
提出日時 | 2022-12-14 09:18:09 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 729 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 82,568 KB |
実行使用メモリ | 79,428 KB |
最終ジャッジ日時 | 2024-04-25 14:21:53 |
合計ジャッジ時間 | 11,897 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
53,200 KB |
testcase_01 | AC | 40 ms
52,568 KB |
testcase_02 | AC | 47 ms
63,356 KB |
testcase_03 | AC | 72 ms
67,560 KB |
testcase_04 | AC | 4,597 ms
79,428 KB |
testcase_05 | AC | 44 ms
60,016 KB |
testcase_06 | AC | 37 ms
53,288 KB |
testcase_07 | TLE | - |
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 | -- | - |
ソースコード
import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ####################################################################### n,s,k = na() dp = [0] * (s+1) dp[0] = 1 mod = 10**9+7 for i in range(n): ndp = [0] * (s+1) dp,ndp = ndp,dp for j in range(s+1): if ndp[j] == 0: continue for x in range(k if i else 0, s+1): nj = j + x * (n - i) if nj > s: break dp[nj] += ndp[j] dp[nj] %= mod print(dp[-1])