結果
| 問題 |
No.1825 Except One
|
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2022-02-05 18:35:19 |
| 言語 | cLay (20241019-1) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 3,000 ms |
| コード長 | 324 bytes |
| コンパイル時間 | 2,724 ms |
| コンパイル使用メモリ | 174,600 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 13:37:44 |
| 合計ジャッジ時間 | 3,250 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 31 |
ソースコード
ll dp[51][1 << 13], ans;
int a[50];
{
int @n;
rd(a(n));
sort(a, a + n);
dp[0][0] = 1;
rep(i, n) {
rrep(l, i + 1) {
rrep(s, 100 * l + 1) {
if(dp[l][s] == 0) { continue; }
int ss = s + a[i];
dp[l + 1][ss] += dp[l][s];
if(l > 0 && ss % l == 0 && a[i] <= ss / l) { ans += dp[l][s]; }
}
}
}
wt(ans);
}
FF256grhy