結果
| 問題 | No.1463 Hungry Kanten |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-18 04:23:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 337 ms / 2,000 ms |
| + 760µs | |
| コード長 | 314 bytes |
| 記録 | |
| コンパイル時間 | 234 ms |
| コンパイル使用メモリ | 96,496 KB |
| 実行使用メモリ | 131,504 KB |
| 最終ジャッジ日時 | 2026-07-12 09:10:20 |
| 合計ジャッジ時間 | 4,719 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
n, k = map(int, input().split())
A = list(map(int, input().split()))
se = set()
for bit in range(1 << n):
if bin(bit).count("1") < k:
continue
tot = 0
prod = 1
for i in range(n):
if bit >> i & 1:
tot += A[i]
prod *= A[i]
se |= {tot, prod}
print(len(se))