結果

問題 No.1463 Hungry Kanten
コンテスト
ユーザー 👑 rin204
提出日時 2022-01-18 04:23:45
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 289 ms / 2,000 ms
+ 650µs
コード長 314 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 325 ms
コンパイル使用メモリ 64,420 KB
実行使用メモリ 92,920 KB
最終ジャッジ日時 2026-10-15 13:32:03
合計ジャッジ時間 4,154 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, k = map(int, input().split())
A = list(map(int, input().split()))
se = set()

for bit in range(1 << n):
    if bin(bit).count("1") < k:
        continue
    tot = 0
    prod = 1
    for i in range(n):
        if bit >> i & 1:
            tot += A[i]
            prod *= A[i]
    se |= {tot, prod}
print(len(se))
0