結果

問題 No.1463 Hungry Kanten
ユーザー MtSaka
提出日時 2021-03-08 13:29:19
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,846 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 47,256 KB
最終ジャッジ日時 2025-06-20 01:30:01
合計ジャッジ時間 11,875 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = []
for i in range(0, (1 << n)):
    al = 0
    cnt = 0
    pro = 1
    for j in range(0, n):
        if i & (1 << j):
            al+=a[j]
            pro*=a[j]
            cnt+=1
        
    if cnt >= k:
        b.append(al)
        b.append(pro)
    

print(len(set(b)))
0