結果

問題 No.1463 Hungry Kanten
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-04-02 21:30:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 288 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 86,696 KB
実行使用メモリ 114,400 KB
最終ジャッジ日時 2023-08-25 14:47:12
合計ジャッジ時間 4,111 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
70,960 KB
testcase_01 AC 58 ms
71,264 KB
testcase_02 AC 85 ms
76,972 KB
testcase_03 AC 213 ms
77,260 KB
testcase_04 AC 72 ms
76,300 KB
testcase_05 AC 288 ms
114,400 KB
testcase_06 AC 67 ms
71,236 KB
testcase_07 AC 58 ms
70,936 KB
testcase_08 AC 57 ms
71,112 KB
testcase_09 AC 63 ms
71,264 KB
testcase_10 AC 72 ms
76,384 KB
testcase_11 AC 70 ms
76,148 KB
testcase_12 AC 74 ms
76,356 KB
testcase_13 AC 73 ms
76,484 KB
testcase_14 AC 76 ms
76,320 KB
testcase_15 AC 76 ms
76,600 KB
testcase_16 AC 76 ms
77,264 KB
testcase_17 AC 93 ms
80,612 KB
testcase_18 AC 99 ms
77,404 KB
testcase_19 AC 154 ms
93,820 KB
testcase_20 AC 230 ms
101,840 KB
testcase_21 AC 64 ms
76,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

S = set()


N,K = map(int,stdin.readline().split())
A = list(map(int,stdin.readline().split()))

for i in range(2**N):

    ss = 0
    mm = 1
    popcnt = 0
    for j in range(N):

        if 2**j & i > 0:
            popcnt += 1
            ss += A[j]
            mm *= A[j]

    if popcnt >= K:
        S.add(ss)
        S.add(mm)

#print (S)
print (len(S))
0