結果
| 問題 | No.1463 Hungry Kanten |
| コンテスト | |
| ユーザー |
🍮かんプリン
|
| 提出日時 | 2021-04-02 22:35:05 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 1,462 ms / 2,000 ms |
| コード長 | 374 bytes |
| 記録 | |
| コンパイル時間 | 381 ms |
| コンパイル使用メモリ | 20,956 KB |
| 実行使用メモリ | 51,240 KB |
| 最終ジャッジ日時 | 2026-05-29 21:08:27 |
| 合計ジャッジ時間 | 10,478 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
def bpc(n):
ans = 0
while n:
if n & 1: ans += 1
n >>= 1
return ans
n,k = map(int,input().split())
a = list(map(int,input().split()))
s = []
for i in range(1<<n):
if bpc(i) < k: continue
sum = 0
mul = 1
for j in range(n):
if i & (1<<j):
sum += a[j]
mul *= a[j]
s += [sum,mul]
print(len(set(s)))
🍮かんプリン