The problem link is : Problem
I can only think of an exponential checker.
What complexity checkers are feasible for contest problems in polygon ?
The problem link is : Problem
I can only think of an exponential checker.
What complexity checkers are feasible for contest problems in polygon ?
| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 144 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 136 |
| 8 | BledDest | 132 |
| 8 | maroonrk | 132 |
| 10 | qwexd | 129 |
| Name |
|---|



Auto comment: topic has been updated by Kartik-Singh (previous revision, new revision, compare).
Let's say we want to eliminate number X then we do so greedily starting from the first occurrence easy to proof its correctness, now go from numbers 0 to n and try to eliminate them, this can be done by storing for each number the indices it occurs in, nlogn for easy implementation, o(n) is easily achievable as well.
We stop at the first number we are able to eliminate and it's our mex.
The general idea of the algorithm is the same as finding the minimum number of segments of length x that cover a set of indices which is doable in o(n) greedily if the indices are sorted
Basically, if (M+1)*K is still less than or equal to N, it is always better to loop from 1 to (N/(M+1)). If (M+1)*K is larger than N, then you can just loop from 1 to K. You do not want to loop from 1 to a smaller number than K, though. I think this is easier than complexity checkers