結果

問題 No.1463 Hungry Kanten
ユーザー Kite_kumaKite_kuma
提出日時 2021-04-03 02:50:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 1,181 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 114,484 KB
最終ジャッジ日時 2023-08-25 17:42:05
合計ジャッジ時間 4,517 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,224 KB
testcase_01 AC 72 ms
71,188 KB
testcase_02 AC 92 ms
77,128 KB
testcase_03 AC 215 ms
77,116 KB
testcase_04 AC 85 ms
76,404 KB
testcase_05 AC 325 ms
114,484 KB
testcase_06 AC 71 ms
71,248 KB
testcase_07 AC 71 ms
71,236 KB
testcase_08 AC 72 ms
71,204 KB
testcase_09 AC 71 ms
71,284 KB
testcase_10 AC 77 ms
76,548 KB
testcase_11 AC 81 ms
76,260 KB
testcase_12 AC 85 ms
76,528 KB
testcase_13 AC 83 ms
76,348 KB
testcase_14 AC 85 ms
76,496 KB
testcase_15 AC 89 ms
76,548 KB
testcase_16 AC 93 ms
77,776 KB
testcase_17 AC 108 ms
80,476 KB
testcase_18 AC 108 ms
77,320 KB
testcase_19 AC 174 ms
93,652 KB
testcase_20 AC 262 ms
102,052 KB
testcase_21 AC 79 ms
76,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
se = set()
for bits in range(1 << n):
    cnt = 0
    s = 0
    p = 1
    for j in range(n):
        if bits & (1 << j):
            cnt += 1
            p *= a[j]
            s += a[j]
    if cnt < k:
        continue
    se.add(s)
    se.add(p)

print(len(se))
0