結果
| 問題 | No.1463 Hungry Kanten |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-05 00:39:50 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 299 ms / 2,000 ms |
| + 349µs | |
| コード長 | 364 bytes |
| 記録 | |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 95,732 KB |
| 実行使用メモリ | 166,632 KB |
| 最終ジャッジ日時 | 2026-07-12 09:07:03 |
| 合計ジャッジ時間 | 4,832 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
import itertools
import functools
import operator
N,K = map(int,input().split())
A = list(map(int,input().split()))
cmb = []
for i in range(K,N+1):
tmp = list(itertools.combinations(A,i))
for t in tmp:
cmb.append(t)
ans = set([])
for c in cmb:
ans.add(sum(c))
ans.add(functools.reduce(operator.mul, c))
print(len(ans))