結果

問題 No.1463 Hungry Kanten
ユーザー Konton7
提出日時 2021-05-11 02:32:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 817 ms
コンパイル使用メモリ 82,092 KB
実行使用メモリ 112,668 KB
最終ジャッジ日時 2025-06-20 01:37:49
合計ジャッジ時間 3,397 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

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