結果
| 問題 | No.1463 Hungry Kanten |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-01 01:54:29 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 1,299 ms / 2,000 ms |
| + 7µs | |
| コード長 | 322 bytes |
| 記録 | |
| コンパイル時間 | 301 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 35,448 KB |
| 最終ジャッジ日時 | 2026-07-12 09:06:52 |
| 合計ジャッジ時間 | 9,396 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
n, k = map(int, input().split())
xs = list(map(int, input().split()))
ys = set()
for b in range(1 << n):
if bin(b).count('1') < k:
continue
s, p = 0, 1
for i in range(n):
if (~b >> i) & 1:
continue
s += xs[i]
p *= xs[i]
ys.add(s)
ys.add(p)
print(len(ys))