結果

問題 No.1463 Hungry Kanten
ユーザー otsunekootsuneko
提出日時 2021-05-05 00:39:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 470 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 163,636 KB
最終ジャッジ日時 2023-10-01 01:54:44
合計ジャッジ時間 5,483 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
72,044 KB
testcase_01 AC 98 ms
72,332 KB
testcase_02 AC 160 ms
79,656 KB
testcase_03 AC 331 ms
123,132 KB
testcase_04 AC 101 ms
72,260 KB
testcase_05 AC 470 ms
163,636 KB
testcase_06 AC 100 ms
72,328 KB
testcase_07 AC 98 ms
72,252 KB
testcase_08 AC 98 ms
72,156 KB
testcase_09 AC 99 ms
72,508 KB
testcase_10 AC 100 ms
72,396 KB
testcase_11 AC 103 ms
76,220 KB
testcase_12 AC 108 ms
76,384 KB
testcase_13 AC 109 ms
76,348 KB
testcase_14 AC 121 ms
77,460 KB
testcase_15 AC 105 ms
76,288 KB
testcase_16 AC 128 ms
80,140 KB
testcase_17 AC 152 ms
85,420 KB
testcase_18 AC 122 ms
79,800 KB
testcase_19 AC 279 ms
115,020 KB
testcase_20 AC 331 ms
129,208 KB
testcase_21 AC 105 ms
76,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import functools
import operator

N,K = map(int,input().split())
A = list(map(int,input().split()))

cmb = []
for i in range(K,N+1):
    tmp = list(itertools.combinations(A,i))
    for t in tmp:
        cmb.append(t)

ans = set([])
for c in cmb:
    ans.add(sum(c))
    ans.add(functools.reduce(operator.mul, c))

print(len(ans))
0