結果
| 問題 |
No.1956 猫の額
|
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-16 15:30:18 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 603 bytes |
| コンパイル時間 | 6,751 ms |
| コンパイル使用メモリ | 196,968 KB |
| 実行使用メモリ | 24,704 KB |
| 最終ジャッジ日時 | 2025-04-16 15:34:05 |
| 合計ジャッジ時間 | 24,164 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 MLE * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, C;
cin >> N >> M >> C;
vector<int> A(N);
for (int &a : A) cin >> a;
int S = accumulate(A.begin(), A.end(), 0);
vector<vector<int>> dp(C + 1, vector<int>(S + 1, 0));
dp[0][0] = 1;
for (int a : A) {
for (int j = C; j >= 1; --j) {
for (int s = S; s >= a; --s) {
dp[j][s] = (dp[j][s] + dp[j - 1][s - a]) % M;
}
}
}
for (int s = 1; s <= S; ++s) {
cout << dp[C][s] % M << (s < S ? ' ' : '\n');
}
return 0;
}
lam6er