結果

問題 No.1463 Hungry Kanten
ユーザー 👑 rin204rin204
提出日時 2022-01-18 04:23:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 499 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 125,628 KB
最終ジャッジ日時 2024-05-02 19:16:44
合計ジャッジ時間 4,136 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,840 KB
testcase_01 AC 38 ms
52,352 KB
testcase_02 AC 86 ms
77,312 KB
testcase_03 AC 369 ms
76,268 KB
testcase_04 AC 49 ms
60,416 KB
testcase_05 AC 499 ms
125,628 KB
testcase_06 AC 39 ms
51,968 KB
testcase_07 AC 38 ms
51,840 KB
testcase_08 AC 39 ms
52,224 KB
testcase_09 AC 38 ms
52,456 KB
testcase_10 AC 52 ms
61,056 KB
testcase_11 AC 49 ms
61,440 KB
testcase_12 AC 56 ms
65,536 KB
testcase_13 AC 49 ms
62,336 KB
testcase_14 AC 62 ms
70,016 KB
testcase_15 AC 67 ms
69,248 KB
testcase_16 AC 86 ms
77,824 KB
testcase_17 AC 110 ms
79,872 KB
testcase_18 AC 105 ms
76,800 KB
testcase_19 AC 271 ms
95,748 KB
testcase_20 AC 354 ms
105,596 KB
testcase_21 AC 49 ms
61,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))
se = set()

for bit in range(1 << n):
    if bin(bit).count("1") < k:
        continue
    tot = 0
    prod = 1
    for i in range(n):
        if bit >> i & 1:
            tot += A[i]
            prod *= A[i]
    se |= {tot, prod}
print(len(se))
0