結果

問題 No.1463 Hungry Kanten
ユーザー convexineqconvexineq
提出日時 2021-04-03 05:54:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 199 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 1,009 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 132,840 KB
最終ジャッジ日時 2023-08-25 20:05:03
合計ジャッジ時間 3,588 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,648 KB
testcase_01 AC 70 ms
71,220 KB
testcase_02 AC 84 ms
76,888 KB
testcase_03 AC 172 ms
104,144 KB
testcase_04 AC 77 ms
76,116 KB
testcase_05 AC 199 ms
132,840 KB
testcase_06 AC 69 ms
71,276 KB
testcase_07 AC 69 ms
71,476 KB
testcase_08 AC 68 ms
71,568 KB
testcase_09 AC 70 ms
71,468 KB
testcase_10 AC 71 ms
71,264 KB
testcase_11 AC 71 ms
71,344 KB
testcase_12 AC 71 ms
71,144 KB
testcase_13 AC 74 ms
76,092 KB
testcase_14 AC 83 ms
76,368 KB
testcase_15 AC 80 ms
76,344 KB
testcase_16 AC 85 ms
77,072 KB
testcase_17 AC 90 ms
80,664 KB
testcase_18 AC 85 ms
78,688 KB
testcase_19 AC 148 ms
108,712 KB
testcase_20 AC 168 ms
115,668 KB
testcase_21 AC 71 ms
71,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
*a, = map(int,input().split())
N = 1<<n
s = [0]*N
p = [1]*N
v = [0]*N
for i in range(n):
    V = 1<<i
    for j in range(V):
        s[j+V] = s[j] + a[i] 
        p[j+V] = p[j] * a[i] 
        v[j+V] = v[j] + 1 
ans = set()
for i in range(N):
    if v[i] >= k:
        ans.add(s[i])
        ans.add(p[i])
print(len(ans))
0