結果

問題 No.1463 Hungry Kanten
ユーザー chocoruskchocorusk
提出日時 2021-04-02 22:22:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,670 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 28,436 KB
最終ジャッジ日時 2023-08-25 15:01:19
合計ジャッジ時間 8,042 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,968 KB
testcase_01 AC 15 ms
7,880 KB
testcase_02 AC 95 ms
8,976 KB
testcase_03 AC 1,568 ms
7,992 KB
testcase_04 AC 23 ms
7,980 KB
testcase_05 AC 1,670 ms
28,436 KB
testcase_06 AC 16 ms
7,840 KB
testcase_07 AC 16 ms
7,876 KB
testcase_08 AC 15 ms
7,788 KB
testcase_09 AC 16 ms
7,792 KB
testcase_10 AC 17 ms
7,796 KB
testcase_11 AC 18 ms
7,856 KB
testcase_12 AC 20 ms
8,292 KB
testcase_13 AC 23 ms
7,792 KB
testcase_14 AC 34 ms
8,336 KB
testcase_15 AC 49 ms
7,844 KB
testcase_16 AC 94 ms
9,104 KB
testcase_17 AC 191 ms
11,560 KB
testcase_18 AC 384 ms
8,924 KB
testcase_19 AC 808 ms
18,224 KB
testcase_20 AC 1,590 ms
27,568 KB
testcase_21 AC 17 ms
7,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k=map(int, input().split())
a=list(map(int, input().split()))
st=set()
for i in range(1<<n):
    c=0
    s=0
    p=1
    for j in range(n):
        if (i&(1<<j))>0:
            s+=a[j]
            p*=a[j]
            c+=1
    if c>=k:
        st.add(s)
        st.add(p)
print(len(st))
0