結果

問題 No.1463 Hungry Kanten
ユーザー brthyyjpbrthyyjp
提出日時 2021-04-02 21:33:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 220 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 118,736 KB
最終ジャッジ日時 2023-08-25 14:49:51
合計ジャッジ時間 3,370 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
71,472 KB
testcase_01 AC 58 ms
71,556 KB
testcase_02 AC 69 ms
76,888 KB
testcase_03 AC 140 ms
76,812 KB
testcase_04 AC 59 ms
71,444 KB
testcase_05 AC 220 ms
118,736 KB
testcase_06 AC 58 ms
71,336 KB
testcase_07 AC 58 ms
71,496 KB
testcase_08 AC 58 ms
71,536 KB
testcase_09 AC 58 ms
71,472 KB
testcase_10 AC 59 ms
71,536 KB
testcase_11 AC 61 ms
76,116 KB
testcase_12 AC 68 ms
75,980 KB
testcase_13 AC 67 ms
76,200 KB
testcase_14 AC 75 ms
76,276 KB
testcase_15 AC 68 ms
76,348 KB
testcase_16 AC 76 ms
77,240 KB
testcase_17 AC 89 ms
81,332 KB
testcase_18 AC 77 ms
76,620 KB
testcase_19 AC 138 ms
94,580 KB
testcase_20 AC 161 ms
98,384 KB
testcase_21 AC 68 ms
76,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

import itertools
S = set()
for i in range(k, n+1):
    for c in itertools.combinations(A, i):
        s = 0
        m = 1
        for a in c:
            s += a
            m *= a
        S.add(s)
        S.add(m)
print(len(S))
0