結果

問題 No.1701 half price
コンテスト
ユーザー NatsubiSogan
提出日時 2021-10-08 22:12:13
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 385 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 320 ms
コンパイル使用メモリ 85,548 KB
実行使用メモリ 80,888 KB
最終ジャッジ日時 2026-04-03 12:36:03
合計ジャッジ時間 1,872 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, w = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for b in range(1 << n):
	cnt = 0
	l = []
	for i in range(n):
		if b >> i & 1:
			cnt += a[i]
			l.append(a[i])
	f = False
	if cnt == w: f = True
	for b2 in range(1 << len(l)):
		cnt2 = cnt
		for i in range(len(l)):
			if b2 >> i & 1:
				cnt2 -= l[i] // 2
		if cnt2 == w: f = True; break
	ans += f
print(ans)
0