結果

問題 No.1463 Hungry Kanten
ユーザー roarisroaris
提出日時 2021-04-02 21:32:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 127,284 KB
最終ジャッジ日時 2023-08-25 14:48:29
合計ジャッジ時間 3,902 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,564 KB
testcase_01 AC 71 ms
71,484 KB
testcase_02 AC 103 ms
78,636 KB
testcase_03 AC 241 ms
77,796 KB
testcase_04 AC 99 ms
77,360 KB
testcase_05 AC 319 ms
127,284 KB
testcase_06 AC 81 ms
71,516 KB
testcase_07 AC 80 ms
71,636 KB
testcase_08 AC 80 ms
71,564 KB
testcase_09 AC 82 ms
71,516 KB
testcase_10 AC 87 ms
77,384 KB
testcase_11 AC 96 ms
77,740 KB
testcase_12 AC 98 ms
77,776 KB
testcase_13 AC 96 ms
77,836 KB
testcase_14 AC 106 ms
78,124 KB
testcase_15 AC 101 ms
77,904 KB
testcase_16 AC 101 ms
79,676 KB
testcase_17 AC 124 ms
81,440 KB
testcase_18 AC 110 ms
78,620 KB
testcase_19 AC 197 ms
96,792 KB
testcase_20 AC 254 ms
106,588 KB
testcase_21 AC 94 ms
77,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

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

for S in range(1<<N):
    l = []
    
    for i in range(N):
        if (S>>i)&1:
            l.append(A[i])
    
    if len(l)<K:
        continue
    
    s.add(sum(l))
    v = 1
    
    for li in l:
        v *= li
    
    s.add(v)

print(len(s))
0