結果

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

ソースコード

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 (w-sum(b))*2 in b:
			c+=1
print(c)
0