結果

問題 No.1463 Hungry Kanten
ユーザー Konton7Konton7
提出日時 2021-05-11 02:32:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 81,732 KB
実行使用メモリ 111,868 KB
最終ジャッジ日時 2023-10-21 07:29:57
合計ジャッジ時間 3,058 ms
ジャッジサーバーID
(参考情報)
judge14 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,468 KB
testcase_01 AC 39 ms
53,468 KB
testcase_02 AC 61 ms
68,856 KB
testcase_03 AC 189 ms
75,500 KB
testcase_04 AC 52 ms
64,292 KB
testcase_05 AC 305 ms
111,868 KB
testcase_06 AC 39 ms
53,468 KB
testcase_07 AC 38 ms
53,468 KB
testcase_08 AC 38 ms
53,468 KB
testcase_09 AC 39 ms
53,468 KB
testcase_10 AC 43 ms
60,000 KB
testcase_11 AC 48 ms
61,764 KB
testcase_12 AC 51 ms
62,300 KB
testcase_13 AC 50 ms
62,168 KB
testcase_14 AC 54 ms
64,300 KB
testcase_15 AC 57 ms
66,428 KB
testcase_16 AC 63 ms
71,324 KB
testcase_17 AC 73 ms
77,056 KB
testcase_18 AC 79 ms
76,156 KB
testcase_19 AC 155 ms
93,340 KB
testcase_20 AC 229 ms
96,732 KB
testcase_21 AC 46 ms
60,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = [int(i) for i in input().split()]
num = [int(i) for i in input().split()]
ans = set([])

for i in range(1 << n):
    s = 0
    p = 1
    c = 0
    for j in range(n):
        if (i >> j) & 1:
            s += num[j]
            p *= num[j]
            c += 1
    if c >= k:
        ans.add(p)
        ans.add(s)
        
print(len(ans))  
0