結果
| 問題 | No.1463 Hungry Kanten |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-02 21:39:41 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 254 ms / 2,000 ms |
| + 333µs | |
| コード長 | 295 bytes |
| 記録 | |
| コンパイル時間 | 230 ms |
| コンパイル使用メモリ | 96,104 KB |
| 実行使用メモリ | 124,116 KB |
| 最終ジャッジ日時 | 2026-07-12 08:54:15 |
| 合計ジャッジ時間 | 3,867 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
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))