| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | jiangly | 3670 |
| 3 | Kevin114514 | 3657 |
| 4 | maroonrk | 3355 |
| 5 | Um_nik | 3353 |
| 6 | squareOf105 | 3346 |
| 7 | tourist | 3343 |
| 8 | strapple | 3324 |
| 9 | heuristica | 3322 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | AmShZ | 143 |
| 5 | Um_nik | 141 |
| 6 | Errichto | 139 |
| 7 | adamant | 137 |
| 8 | BledDest | 133 |
| 8 | maroonrk | 133 |
| 10 | qwexd | 130 |
|
0
Problem E description is absolute garbage. First of all why are the free cells denoted with '1' when the general convention in many of the problems we have solved is the other way around. Also it is not really clear from the description whether the whole component should be inside the interval or just need to have a cell in the interval. Believe it or not if you flip the 0 and 1 and consider the case where the whole component should be in the interval, the answer from the sample test checks out. Wasted like 2 hours trying to figure out what was going on. |
|
+3
You can just brute force on y, because it's at most W — 1, because you can always replace W draws with D wins and minimize it. |
|
0
You can use extended Euclidean algorithm to find x and y(keep in mind there can be more than one solution to the linear combination, so you need to take the one where y is minimal while still being >= 0). |
|
+8
It can actually be improved to $$$O(n)$$$ easily by also storing the 2 best subarrays of length $$$\leq m$$$ for $$$i - 1$$$ so you don't have to do a for loop. |
|
0
You can check my solution, Only $$$j = i - m$$$ needs to be considered, Otherwise just take max subarray ending at $$$i$$$ with length $$$\leq m$$$. |
|
+8
It can be solved with a very simple DP, where DP[i] = maximum subarray ending at index i. Then for the transition we have two choices — the length of the max subarray ending at i is at most m, or it is more than m. First case can be computed in constant time, and for the second case we have DP[i — m] + A[i — m + 1] + ... + A[i] — k. |
| Name |
|---|


