| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 153 |
| 2 | nik_exists | 151 |
| 3 | maroonrk | 150 |
| 4 | maspy | 149 |
| 5 | AmShZ | 146 |
| 6 | Um_nik | 143 |
| 7 | Errichto | 139 |
| 8 | adamant | 135 |
| 9 | BledDest | 134 |
| 10 | cry | 130 |
|
0
s=abcbadeeabc... |
|
+5
For problem D, when n = m =10^6 and t =10^7, O(n(logn)^2) is really same as O(tlogm). But to my surprise, the former get TLE! |
|
0
More precisely, we should consider the size relation between 2n-3 and m, rather than 2n. As jo_on put it above, overflow mod m may happen in some situation. In fact, the boundary condition is that the sum of the two largest differences(in absolute value) of element pairs equals to m*d. That is pairs (s,s+(n-1)d) and (s,s+(n-2)d), whose sum of differences is (2n-3)d.So we should consider the size relation between 2n-3 and m. Once 2n-3<m, the insecurity, namely overflow mod m won't happen. In short, when 2n-1=m, the case must be safe.In practice, whether 2n or 2n-3, both of them can get accepted. |
| Name |
|---|


