結果

問題 No.1463 Hungry Kanten
ユーザー wolgnikwolgnik
提出日時 2021-04-02 21:25:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 345 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 82,120 KB
実行使用メモリ 124,636 KB
最終ジャッジ日時 2024-12-23 23:17:41
合計ジャッジ時間 3,065 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import combinations as combi
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
res = set()
for t in range(K, N + 1):
  for c in combi([x for x in a], t):
    sm = sum(c)
    pr = 1
    for x in c: pr *= x
    res.add(sm)
    res.add(pr)
print(len(res))
0