結果

問題 No.1825 Except One
ユーザー FF256grhyFF256grhy
提出日時 2022-02-05 18:35:19
言語 cLay
(20240104-1)
結果
AC  
実行時間 6 ms / 3,000 ms
コード長 324 bytes
コンパイル時間 1,857 ms
コンパイル使用メモリ 163,172 KB
実行使用メモリ 5,936 KB
最終ジャッジ日時 2023-09-02 06:48:54
合計ジャッジ時間 3,429 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,408 KB
testcase_01 AC 2 ms
5,556 KB
testcase_02 AC 2 ms
5,544 KB
testcase_03 AC 6 ms
5,816 KB
testcase_04 AC 4 ms
5,864 KB
testcase_05 AC 2 ms
5,652 KB
testcase_06 AC 2 ms
5,420 KB
testcase_07 AC 5 ms
5,716 KB
testcase_08 AC 5 ms
5,936 KB
testcase_09 AC 2 ms
5,436 KB
testcase_10 AC 5 ms
5,832 KB
testcase_11 AC 3 ms
5,568 KB
testcase_12 AC 3 ms
5,668 KB
testcase_13 AC 2 ms
5,732 KB
testcase_14 AC 2 ms
5,476 KB
testcase_15 AC 2 ms
5,588 KB
testcase_16 AC 2 ms
5,472 KB
testcase_17 AC 2 ms
5,480 KB
testcase_18 AC 2 ms
5,404 KB
testcase_19 AC 2 ms
5,404 KB
testcase_20 AC 2 ms
5,408 KB
testcase_21 AC 2 ms
5,416 KB
testcase_22 AC 2 ms
5,416 KB
testcase_23 AC 2 ms
5,488 KB
testcase_24 AC 3 ms
5,504 KB
testcase_25 AC 2 ms
5,508 KB
testcase_26 AC 2 ms
5,708 KB
testcase_27 AC 3 ms
5,736 KB
testcase_28 AC 4 ms
5,588 KB
testcase_29 AC 2 ms
5,484 KB
testcase_30 AC 2 ms
5,512 KB
testcase_31 AC 2 ms
5,496 KB
testcase_32 AC 6 ms
5,800 KB
testcase_33 AC 2 ms
5,424 KB
testcase_34 AC 4 ms
5,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
}
0