結果
問題 |
No.1463 Hungry Kanten
|
ユーザー |
|
提出日時 | 2021-05-01 01:54:45 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 431 ms / 2,000 ms |
コード長 | 322 bytes |
コンパイル時間 | 323 ms |
コンパイル使用メモリ | 82,380 KB |
実行使用メモリ | 121,324 KB |
最終ジャッジ日時 | 2025-06-20 01:37:32 |
合計ジャッジ時間 | 4,050 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
n, k = map(int, input().split()) xs = list(map(int, input().split())) ys = set() for b in range(1 << n): if bin(b).count('1') < k: continue s, p = 0, 1 for i in range(n): if (~b >> i) & 1: continue s += xs[i] p *= xs[i] ys.add(s) ys.add(p) print(len(ys))