結果

問題 No.1463 Hungry Kanten
ユーザー 👑 H20H20
提出日時 2021-04-02 21:42:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 351 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 567 ms
コンパイル使用メモリ 86,760 KB
実行使用メモリ 224,396 KB
最終ジャッジ日時 2023-08-25 14:53:36
合計ジャッジ時間 4,212 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
70,820 KB
testcase_01 AC 58 ms
71,356 KB
testcase_02 AC 84 ms
78,864 KB
testcase_03 AC 293 ms
163,236 KB
testcase_04 AC 58 ms
70,976 KB
testcase_05 AC 351 ms
224,396 KB
testcase_06 AC 61 ms
71,352 KB
testcase_07 AC 58 ms
71,068 KB
testcase_08 AC 57 ms
71,356 KB
testcase_09 AC 58 ms
71,020 KB
testcase_10 AC 62 ms
70,856 KB
testcase_11 AC 66 ms
75,128 KB
testcase_12 AC 68 ms
75,672 KB
testcase_13 AC 62 ms
75,192 KB
testcase_14 AC 75 ms
76,500 KB
testcase_15 AC 64 ms
75,404 KB
testcase_16 AC 85 ms
79,284 KB
testcase_17 AC 101 ms
86,340 KB
testcase_18 AC 83 ms
78,452 KB
testcase_19 AC 205 ms
141,120 KB
testcase_20 AC 243 ms
160,716 KB
testcase_21 AC 63 ms
74,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

def mul(L):
    ret = 1
    for l in L:
        ret*=l
    return ret

N,K = map(int,input().split())
A = list(map(int,input().split()))
pattern = []
for i in range(K,N+1):
    for l in list(itertools.combinations(A, i)):
        pattern.append(sum(l))
        pattern.append(mul(l))

print(len(list(set(pattern))))

0