結果
問題 | No.1463 Hungry Kanten |
ユーザー | wolgnik |
提出日時 | 2021-04-02 21:25:50 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 345 ms / 2,000 ms |
コード長 | 324 bytes |
コンパイル時間 | 271 ms |
コンパイル使用メモリ | 82,120 KB |
実行使用メモリ | 124,636 KB |
最終ジャッジ日時 | 2024-12-23 23:17:41 |
合計ジャッジ時間 | 3,065 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
import sys from itertools import combinations as combi input = sys.stdin.readline N, K = map(int, input().split()) a = list(map(int, input().split())) res = set() for t in range(K, N + 1): for c in combi([x for x in a], t): sm = sum(c) pr = 1 for x in c: pr *= x res.add(sm) res.add(pr) print(len(res))