結果

問題 No.1463 Hungry Kanten
ユーザー MtSakaMtSaka
提出日時 2021-03-08 13:30:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 297 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 153,852 KB
最終ジャッジ日時 2023-08-25 14:44:28
合計ジャッジ時間 3,529 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
70,988 KB
testcase_01 AC 61 ms
71,224 KB
testcase_02 AC 138 ms
77,136 KB
testcase_03 AC 256 ms
118,300 KB
testcase_04 AC 70 ms
76,180 KB
testcase_05 AC 297 ms
153,852 KB
testcase_06 AC 59 ms
71,204 KB
testcase_07 AC 59 ms
71,168 KB
testcase_08 AC 60 ms
71,344 KB
testcase_09 AC 62 ms
71,084 KB
testcase_10 AC 63 ms
76,220 KB
testcase_11 AC 69 ms
76,012 KB
testcase_12 AC 67 ms
76,796 KB
testcase_13 AC 67 ms
76,468 KB
testcase_14 AC 71 ms
76,736 KB
testcase_15 AC 71 ms
76,408 KB
testcase_16 AC 76 ms
77,684 KB
testcase_17 AC 88 ms
83,384 KB
testcase_18 AC 88 ms
77,492 KB
testcase_19 AC 162 ms
111,468 KB
testcase_20 AC 246 ms
124,420 KB
testcase_21 AC 72 ms
76,452 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