結果

問題 No.1463 Hungry Kanten
ユーザー kept1994kept1994
提出日時 2021-09-01 00:06:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 253 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 115,740 KB
最終ジャッジ日時 2023-08-17 14:56:13
合計ジャッジ時間 4,029 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,468 KB
testcase_01 AC 68 ms
71,348 KB
testcase_02 AC 79 ms
76,284 KB
testcase_03 AC 161 ms
76,432 KB
testcase_04 AC 73 ms
71,536 KB
testcase_05 AC 253 ms
115,740 KB
testcase_06 AC 69 ms
71,228 KB
testcase_07 AC 70 ms
71,500 KB
testcase_08 AC 72 ms
71,452 KB
testcase_09 AC 73 ms
71,392 KB
testcase_10 AC 70 ms
71,448 KB
testcase_11 AC 71 ms
75,316 KB
testcase_12 AC 73 ms
75,644 KB
testcase_13 AC 74 ms
75,548 KB
testcase_14 AC 80 ms
75,868 KB
testcase_15 AC 76 ms
75,792 KB
testcase_16 AC 79 ms
76,628 KB
testcase_17 AC 93 ms
79,864 KB
testcase_18 AC 78 ms
76,116 KB
testcase_19 AC 149 ms
93,336 KB
testcase_20 AC 183 ms
99,632 KB
testcase_21 AC 72 ms
75,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys

def main():
    from itertools import combinations
    N, K = map(int,input().split())
    A = list(map(int, input().split()))
    res = set()
    for kk in range(K, N + 1):
        for p in combinations(A, kk):
            sum = 0
            mul = 1
            for i in p:
                sum += i
                mul *= i
            res.add(sum)
            res.add(mul)
    # print(res)
    print(len(res))
        
if __name__ == '__main__':
    main()
0