結果

問題 No.1463 Hungry Kanten
ユーザー 👑 tamatotamato
提出日時 2021-04-02 21:27:20
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 310 ms / 2,000 ms
コード長 507 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 87,536 KB
実行使用メモリ 119,812 KB
最終ジャッジ日時 2023-08-26 02:49:21
合計ジャッジ時間 4,004 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,588 KB
testcase_01 AC 64 ms
71,508 KB
testcase_02 AC 81 ms
77,012 KB
testcase_03 AC 196 ms
77,060 KB
testcase_04 AC 75 ms
76,512 KB
testcase_05 AC 310 ms
119,812 KB
testcase_06 AC 68 ms
71,580 KB
testcase_07 AC 70 ms
71,416 KB
testcase_08 AC 67 ms
71,524 KB
testcase_09 AC 67 ms
71,452 KB
testcase_10 AC 74 ms
76,500 KB
testcase_11 AC 75 ms
76,480 KB
testcase_12 AC 77 ms
76,808 KB
testcase_13 AC 78 ms
76,532 KB
testcase_14 AC 80 ms
76,460 KB
testcase_15 AC 80 ms
76,768 KB
testcase_16 AC 85 ms
77,492 KB
testcase_17 AC 97 ms
80,432 KB
testcase_18 AC 100 ms
77,456 KB
testcase_19 AC 163 ms
92,964 KB
testcase_20 AC 228 ms
103,884 KB
testcase_21 AC 72 ms
76,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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

    S = set()
    for i in range(1 << N):
        s = 0
        p = 1
        cnt = 0
        for j in range(N):
            if i >> j & 1:
                cnt += 1
                s += A[j]
                p *= A[j]
        if cnt >= K:
            S.add(s)
            S.add(p)
    print(len(S))


if __name__ == '__main__':
    main()
0