結果

問題 No.1463 Hungry Kanten
コンテスト
ユーザー tktk_snsn
提出日時 2021-04-02 23:48:35
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 642 ms / 2,000 ms
+ 886µs
コード長 314 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 58 ms
コンパイル使用メモリ 14,720 KB
実行使用メモリ 31,932 KB
最終ジャッジ日時 2026-10-15 12:12:52
合計ジャッジ時間 5,857 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from itertools import combinations
n, k = map(int, input().split())
A = list(map(int, input().split()))

ans = set()
for i in range(k, n+1):
    for P in combinations(A, i):
        x = 0
        y = 1
        for p in P:
            x += p
            y *= p
        ans.add(x)
        ans.add(y)

print(len(ans))
0