結果
問題 | No.3046 yukicoderの過去問 |
ユーザー | zutsu |
提出日時 | 2022-05-10 22:41:56 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 394 bytes |
コンパイル時間 | 261 ms |
コンパイル使用メモリ | 87,040 KB |
実行使用メモリ | 840,860 KB |
最終ジャッジ日時 | 2023-09-25 06:41:56 |
合計ジャッジ時間 | 3,081 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 70 ms
71,136 KB |
testcase_01 | AC | 68 ms
71,184 KB |
testcase_02 | AC | 68 ms
71,384 KB |
testcase_03 | MLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
ソースコード
K = int(input()) N = int(input()) X = list(map(int, input().split())) dp = [[0]*K for _ in range(K)] mod = 10**9 + 7 for x in X: if x < K: dp[0][x-1] = 1 ans = 0 for i in range(1,K): for j in range(X[0]*i,K): for x in X: if 0 <= j-x < K: dp[i][j] += dp[i-1][j-x] dp[i][j] %= mod ans += dp[i][-1] ans %= mod print(ans)