結果

問題 No.1701 half price
ユーザー sasa8uyauyasasa8uyauya
提出日時 2024-08-08 19:54:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 208 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 76,760 KB
最終ジャッジ日時 2024-08-08 19:54:49
合計ジャッジ時間 2,463 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 12 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

n,w=map(int,input().split())
a=list(map(int,input().split()))
c=0
for i in range(1,1<<n):
	b=[a[j] for j in range(n) if (i>>j)&1]
	if sum(b)==w:
		c+=1
	elif sum(b)>w:
		if (sum(b)-w)*2 in b:
			c+=1
print(c)
0