結果

問題 No.1463 Hungry Kanten
ユーザー Mottchan
提出日時 2023-03-26 19:06:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 163,740 KB
最終ジャッジ日時 2025-06-20 01:41:57
合計ジャッジ時間 3,547 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
n,k=map(int, input().split())
num = list(map(int, input().split()))

ans=[]
for pro in product((0, 1), repeat=n):
    a=0
    b=1
    if sum(pro) >= k:
        for i in range(n):
            if pro[i]:
                a += num[i]
                b *= num[i]
        ans.append(a)
        ans.append(b)

print(len(set(ans)))
0