結果

問題 No.1463 Hungry Kanten
ユーザー MottchanMottchan
提出日時 2023-03-26 19:06:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 386 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 214 ms
コンパイル使用メモリ 81,508 KB
実行使用メモリ 163,060 KB
最終ジャッジ日時 2023-10-19 13:49:16
合計ジャッジ時間 4,725 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,416 KB
testcase_01 AC 40 ms
53,416 KB
testcase_02 AC 91 ms
77,184 KB
testcase_03 AC 355 ms
124,816 KB
testcase_04 AC 48 ms
62,084 KB
testcase_05 AC 386 ms
163,060 KB
testcase_06 AC 38 ms
53,420 KB
testcase_07 AC 38 ms
53,420 KB
testcase_08 AC 39 ms
53,420 KB
testcase_09 AC 39 ms
53,420 KB
testcase_10 AC 45 ms
59,656 KB
testcase_11 AC 49 ms
61,868 KB
testcase_12 AC 54 ms
64,524 KB
testcase_13 AC 52 ms
64,352 KB
testcase_14 AC 62 ms
70,716 KB
testcase_15 AC 58 ms
70,616 KB
testcase_16 AC 75 ms
77,424 KB
testcase_17 AC 96 ms
81,624 KB
testcase_18 AC 86 ms
76,720 KB
testcase_19 AC 223 ms
113,336 KB
testcase_20 AC 278 ms
128,148 KB
testcase_21 AC 50 ms
62,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
n,k=map(int, input().split())
num = list(map(int, input().split()))

ans=[]
for pro in product((0, 1), repeat=n):
    a=0
    b=1
    if sum(pro) >= k:
        for i in range(n):
            if pro[i]:
                a += num[i]
                b *= num[i]
        ans.append(a)
        ans.append(b)

print(len(set(ans)))
0