結果

問題 No.1463 Hungry Kanten
ユーザー LiesegangLiesegang
提出日時 2021-04-02 22:40:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 367 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 86,804 KB
実行使用メモリ 129,828 KB
最終ジャッジ日時 2023-08-25 15:03:20
合計ジャッジ時間 3,848 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,084 KB
testcase_01 AC 72 ms
71,152 KB
testcase_02 AC 99 ms
78,316 KB
testcase_03 AC 235 ms
77,064 KB
testcase_04 AC 70 ms
71,164 KB
testcase_05 AC 367 ms
129,828 KB
testcase_06 AC 71 ms
71,084 KB
testcase_07 AC 72 ms
71,080 KB
testcase_08 AC 71 ms
71,160 KB
testcase_09 AC 70 ms
71,436 KB
testcase_10 AC 72 ms
71,220 KB
testcase_11 AC 77 ms
75,472 KB
testcase_12 AC 79 ms
75,280 KB
testcase_13 AC 74 ms
75,356 KB
testcase_14 AC 90 ms
76,432 KB
testcase_15 AC 77 ms
75,596 KB
testcase_16 AC 99 ms
78,644 KB
testcase_17 AC 112 ms
80,224 KB
testcase_18 AC 98 ms
78,324 KB
testcase_19 AC 217 ms
99,312 KB
testcase_20 AC 265 ms
106,908 KB
testcase_21 AC 77 ms
75,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

def product(a):
  ans = 1
  for i in a:
    ans *= i
  return ans

n, k = list(map(int, input().split(" ")))
a = list(map(int, input().split(" ")))

s = set()

for i in range(k, n + 1):
  for j in itertools.combinations(a, i):
    s.add(sum(j))
    s.add(product(j))

print(len(s))
0