結果

問題 No.1463 Hungry Kanten
ユーザー titiatitia
提出日時 2021-04-02 21:32:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,497 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 28,452 KB
最終ジャッジ日時 2023-08-25 14:48:56
合計ジャッジ時間 6,901 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,844 KB
testcase_01 AC 16 ms
7,908 KB
testcase_02 AC 82 ms
8,896 KB
testcase_03 AC 1,447 ms
7,880 KB
testcase_04 AC 20 ms
7,832 KB
testcase_05 AC 1,497 ms
28,452 KB
testcase_06 AC 15 ms
7,964 KB
testcase_07 AC 15 ms
7,996 KB
testcase_08 AC 15 ms
7,908 KB
testcase_09 AC 15 ms
7,908 KB
testcase_10 AC 15 ms
7,848 KB
testcase_11 AC 17 ms
7,764 KB
testcase_12 AC 18 ms
8,328 KB
testcase_13 AC 19 ms
7,952 KB
testcase_14 AC 30 ms
8,424 KB
testcase_15 AC 37 ms
7,768 KB
testcase_16 AC 81 ms
9,104 KB
testcase_17 AC 174 ms
11,608 KB
testcase_18 AC 241 ms
8,984 KB
testcase_19 AC 729 ms
18,220 KB
testcase_20 AC 1,301 ms
27,632 KB
testcase_21 AC 16 ms
7,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

for i in range(1<<N):
    X=[]
    for j in range(N):
        if i & (1<<j) != 0:
            X.append(A[j])

    if len(X)>=K:
        ANS.add(sum(X))
        l=1
        for x in X:
            l*=x
        ANS.add(l)

print(len(ANS))
0