結果

問題 No.1463 Hungry Kanten
ユーザー 👑 Kazun
提出日時 2021-04-02 21:28:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 566 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 82,280 KB
実行使用メモリ 132,208 KB
最終ジャッジ日時 2025-06-20 01:30:37
合計ジャッジ時間 4,586 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

def prod(A):
    x=1
    for a in A:
        x*=a
    return x

N,K=map(int,input().split())
A=list(map(int,input().split()))

X=set()
for t in product((0,1),repeat=N):
    if sum(t)<K:
        continue

    B=[A[i] for i in range(N) if t[i]]
    X|={sum(B),prod(B)}
print(len(X))
0