結果

問題 No.1463 Hungry Kanten
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-04-02 21:39:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 442 ms / 2,000 ms
コード長 295 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 86,732 KB
実行使用メモリ 122,868 KB
最終ジャッジ日時 2023-08-25 14:51:29
合計ジャッジ時間 4,351 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,832 KB
testcase_01 AC 71 ms
71,340 KB
testcase_02 AC 100 ms
78,100 KB
testcase_03 AC 325 ms
77,180 KB
testcase_04 AC 77 ms
76,312 KB
testcase_05 AC 442 ms
122,868 KB
testcase_06 AC 72 ms
71,324 KB
testcase_07 AC 72 ms
71,000 KB
testcase_08 AC 72 ms
70,832 KB
testcase_09 AC 72 ms
71,340 KB
testcase_10 AC 80 ms
76,588 KB
testcase_11 AC 81 ms
76,204 KB
testcase_12 AC 86 ms
76,820 KB
testcase_13 AC 84 ms
76,468 KB
testcase_14 AC 92 ms
76,700 KB
testcase_15 AC 89 ms
76,776 KB
testcase_16 AC 100 ms
78,752 KB
testcase_17 AC 122 ms
80,492 KB
testcase_18 AC 122 ms
77,912 KB
testcase_19 AC 260 ms
95,584 KB
testcase_20 AC 348 ms
103,688 KB
testcase_21 AC 80 ms
76,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
A = list(map(int,input().split()))
s = set()

for i in range(1<<n):
    if bin(i).count("1") < k:
        continue
    a = 0
    b = 1
    for j in range(n):
        if i >> j & 1:
            a += A[j]
            b *= A[j]
    s.add(a)
    s.add(b)
print(len(s))
0