結果
問題 | No.1463 Hungry Kanten |
ユーザー |
|
提出日時 | 2023-09-07 20:30:36 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 349 ms / 2,000 ms |
コード長 | 422 bytes |
コンパイル時間 | 299 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 120,888 KB |
最終ジャッジ日時 | 2024-06-25 14:15:27 |
合計ジャッジ時間 | 3,222 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
N,K = map(int,input().split())A = list(map(int,input().split()))def popcnt(x):res = 0while x:res += x & 1x >>= 1return resans = set()for status in range(1 << N):if popcnt(status) < K:continues = 0m = 1for i in range(N):if (status >> i) & 1:s += A[i]m *= A[i]ans.add(s)ans.add(m)print(len(ans))