結果

問題 No.1463 Hungry Kanten
ユーザー kappybar
提出日時 2021-04-02 21:45:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 82,448 KB
実行使用メモリ 112,748 KB
最終ジャッジ日時 2025-06-20 01:32:34
合計ジャッジ時間 3,432 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
a = list(map(int,input().split()))

st = set()

for bit in range(1<<n):
	c = 0
	sum_ = 0
	mul = 1
	for i in range(n):
		if bit>>i&1:
			c += 1
			sum_ += a[i]
			mul *= a[i]
	if c >= k:
		st.add(sum_)
		st.add(mul)

print(len(st))
	
		
    
0