結果

問題 No.1463 Hungry Kanten
ユーザー ygd.ygd.
提出日時 2021-04-02 21:31:16
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 287 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 152,220 KB
最終ジャッジ日時 2023-08-25 14:47:54
合計ジャッジ時間 3,725 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
71,360 KB
testcase_01 AC 56 ms
71,272 KB
testcase_02 AC 78 ms
78,288 KB
testcase_03 AC 201 ms
107,480 KB
testcase_04 AC 59 ms
71,288 KB
testcase_05 AC 287 ms
152,220 KB
testcase_06 AC 58 ms
71,284 KB
testcase_07 AC 57 ms
71,420 KB
testcase_08 AC 57 ms
71,500 KB
testcase_09 AC 57 ms
70,992 KB
testcase_10 AC 57 ms
71,528 KB
testcase_11 AC 63 ms
76,404 KB
testcase_12 AC 69 ms
76,524 KB
testcase_13 AC 66 ms
76,132 KB
testcase_14 AC 83 ms
76,968 KB
testcase_15 AC 68 ms
76,280 KB
testcase_16 AC 81 ms
78,852 KB
testcase_17 AC 91 ms
81,844 KB
testcase_18 AC 79 ms
78,272 KB
testcase_19 AC 183 ms
110,572 KB
testcase_20 AC 218 ms
123,968 KB
testcase_21 AC 68 ms
76,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = set([])
for num in range(K,N+1):
    L = list(itertools.combinations(A,num))
    for X in L:
        ans.add(sum(X))
        temp = 1
        for x in X:
            temp *= x
        ans.add(temp)
#print(ans)
print(len(ans))
0