結果

問題 No.1463 Hungry Kanten
ユーザー MtSakaMtSaka
提出日時 2021-03-08 13:29:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,411 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 45,052 KB
最終ジャッジ日時 2023-08-25 14:44:20
合計ジャッジ時間 6,624 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
7,864 KB
testcase_01 AC 12 ms
7,868 KB
testcase_02 AC 85 ms
9,748 KB
testcase_03 AC 1,402 ms
32,576 KB
testcase_04 AC 19 ms
7,820 KB
testcase_05 AC 1,411 ms
45,052 KB
testcase_06 AC 13 ms
7,780 KB
testcase_07 AC 12 ms
7,816 KB
testcase_08 AC 12 ms
7,816 KB
testcase_09 AC 13 ms
7,868 KB
testcase_10 AC 13 ms
7,864 KB
testcase_11 AC 13 ms
8,008 KB
testcase_12 AC 16 ms
8,400 KB
testcase_13 AC 18 ms
7,820 KB
testcase_14 AC 27 ms
8,536 KB
testcase_15 AC 42 ms
7,784 KB
testcase_16 AC 78 ms
9,732 KB
testcase_17 AC 164 ms
13,660 KB
testcase_18 AC 324 ms
9,436 KB
testcase_19 AC 688 ms
26,300 KB
testcase_20 AC 1,362 ms
35,064 KB
testcase_21 AC 14 ms
7,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = []
for i in range(0, (1 << n)):
    al = 0
    cnt = 0
    pro = 1
    for j in range(0, n):
        if i & (1 << j):
            al+=a[j]
            pro*=a[j]
            cnt+=1
        
    if cnt >= k:
        b.append(al)
        b.append(pro)
    

print(len(set(b)))
0