結果

問題 No.1463 Hungry Kanten
ユーザー wolgnikwolgnik
提出日時 2021-04-02 21:25:50
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 87,324 KB
実行使用メモリ 126,584 KB
最終ジャッジ日時 2023-08-25 14:46:01
合計ジャッジ時間 3,751 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,612 KB
testcase_01 AC 73 ms
71,340 KB
testcase_02 AC 94 ms
78,208 KB
testcase_03 AC 206 ms
77,056 KB
testcase_04 AC 72 ms
71,576 KB
testcase_05 AC 330 ms
126,584 KB
testcase_06 AC 68 ms
71,488 KB
testcase_07 AC 68 ms
71,356 KB
testcase_08 AC 70 ms
71,196 KB
testcase_09 AC 69 ms
71,396 KB
testcase_10 AC 71 ms
71,696 KB
testcase_11 AC 78 ms
76,488 KB
testcase_12 AC 79 ms
76,464 KB
testcase_13 AC 75 ms
76,060 KB
testcase_14 AC 94 ms
76,636 KB
testcase_15 AC 78 ms
76,276 KB
testcase_16 AC 94 ms
78,308 KB
testcase_17 AC 111 ms
81,164 KB
testcase_18 AC 92 ms
78,220 KB
testcase_19 AC 194 ms
95,532 KB
testcase_20 AC 239 ms
105,008 KB
testcase_21 AC 77 ms
76,800 KB
権限があれば一括ダウンロードができます

ソースコード

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