結果

問題 No.1463 Hungry Kanten
ユーザー 👑 KazunKazun
提出日時 2021-04-02 21:28:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 429 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 86,416 KB
実行使用メモリ 134,848 KB
最終ジャッジ日時 2023-08-25 14:46:06
合計ジャッジ時間 3,901 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
70,992 KB
testcase_01 AC 58 ms
70,960 KB
testcase_02 AC 112 ms
78,872 KB
testcase_03 AC 374 ms
77,864 KB
testcase_04 AC 72 ms
75,880 KB
testcase_05 AC 429 ms
134,848 KB
testcase_06 AC 58 ms
71,200 KB
testcase_07 AC 58 ms
70,960 KB
testcase_08 AC 63 ms
71,248 KB
testcase_09 AC 64 ms
70,924 KB
testcase_10 AC 68 ms
75,272 KB
testcase_11 AC 69 ms
75,688 KB
testcase_12 AC 75 ms
75,952 KB
testcase_13 AC 72 ms
76,080 KB
testcase_14 AC 94 ms
77,612 KB
testcase_15 AC 82 ms
76,884 KB
testcase_16 AC 109 ms
79,548 KB
testcase_17 AC 125 ms
81,200 KB
testcase_18 AC 103 ms
78,236 KB
testcase_19 AC 244 ms
103,144 KB
testcase_20 AC 312 ms
113,316 KB
testcase_21 AC 71 ms
75,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

def prod(A):
    x=1
    for a in A:
        x*=a
    return x

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

X=set()
for t in product((0,1),repeat=N):
    if sum(t)<K:
        continue

    B=[A[i] for i in range(N) if t[i]]
    X|={sum(B),prod(B)}
print(len(X))
0