結果
問題 |
No.1956 猫の額
|
ユーザー |
![]() |
提出日時 | 2022-05-24 18:02:45 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 397 bytes |
コンパイル時間 | 190 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 582,532 KB |
最終ジャッジ日時 | 2024-09-20 14:29:04 |
合計ジャッジ時間 | 22,220 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | MLE * 20 -- * 1 |
ソースコード
from collections import defaultdict N,M,C = map(int,input().split()) A = list(map(int,input().split())) S = sum(A) DP = defaultdict(int) DP[0, 0] = 1 for i in range(N): DP2 = defaultdict(int) for k,v in DP.items(): c = k[0] x = k[1] if c < C: DP2[c+1, x+A[i]] += v % M DP2[c, x] += v % M DP = DP2 print(*[DP[C, i] % M for i in range(1,S+1)])