結果

問題 No.1701 half price
ユーザー prussian_coderprussian_coder
提出日時 2022-03-22 21:29:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 339 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 76,672 KB
最終ジャッジ日時 2024-04-18 22:17:38
合計ジャッジ時間 3,688 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,968 KB
testcase_01 AC 37 ms
53,120 KB
testcase_02 AC 132 ms
76,672 KB
testcase_03 AC 38 ms
52,352 KB
testcase_04 AC 128 ms
76,600 KB
testcase_05 AC 56 ms
69,504 KB
testcase_06 AC 502 ms
76,252 KB
testcase_07 AC 525 ms
76,268 KB
testcase_08 WA -
testcase_09 AC 38 ms
52,608 KB
testcase_10 AC 37 ms
52,480 KB
testcase_11 AC 39 ms
53,120 KB
testcase_12 AC 36 ms
52,736 KB
testcase_13 AC 38 ms
52,992 KB
testcase_14 AC 38 ms
52,480 KB
testcase_15 AC 37 ms
52,736 KB
testcase_16 AC 36 ms
52,096 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 35 ms
52,096 KB
testcase_21 AC 505 ms
76,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=[int(x) for x in input().split()]
ans=0

def two(f):
	if f:
		return 2
	else:
		return 1

for i in range(1<<N):
	flag=False
	X=[A[j] for j in range(N) if (i>>j)&1]
	M=len(X)
	for k in range(1<<M):
		if sum([X[j]//(two((k>>j)&1)) for j in range(M)])==K:
			flag=True
			break
	if flag:
		ans+=1
print(ans)
	
	
0