結果

問題 No.1463 Hungry Kanten
ユーザー kappybarkappybar
提出日時 2021-04-02 21:45:30
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 249 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 114,420 KB
最終ジャッジ日時 2023-08-25 14:54:25
合計ジャッジ時間 3,228 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,208 KB
testcase_01 AC 61 ms
71,012 KB
testcase_02 AC 79 ms
77,256 KB
testcase_03 AC 188 ms
77,148 KB
testcase_04 AC 69 ms
76,444 KB
testcase_05 AC 249 ms
114,420 KB
testcase_06 AC 61 ms
71,180 KB
testcase_07 AC 62 ms
71,280 KB
testcase_08 AC 61 ms
71,232 KB
testcase_09 AC 58 ms
71,352 KB
testcase_10 AC 62 ms
76,496 KB
testcase_11 AC 72 ms
76,104 KB
testcase_12 AC 72 ms
76,936 KB
testcase_13 AC 67 ms
76,740 KB
testcase_14 AC 70 ms
76,648 KB
testcase_15 AC 70 ms
76,856 KB
testcase_16 AC 75 ms
77,444 KB
testcase_17 AC 86 ms
81,264 KB
testcase_18 AC 90 ms
77,980 KB
testcase_19 AC 146 ms
94,080 KB
testcase_20 AC 213 ms
102,060 KB
testcase_21 AC 70 ms
76,540 KB
権限があれば一括ダウンロードができます

ソースコード

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