| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3382 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 155 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 145 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 134 |
| 9 | maroonrk | 132 |
| 10 | cry | 130 |
|
+8
B: let's fix $$$i$$$ as the beginning of $$$s2$$$ and $$$j$$$ as the ending (exclusive) of $$$s3$$$. We need to count in how many ways we can set $$$s1=s2$$$ and in how many ways we can set $$$s5+s6=s2+s3$$$ and then add the product of these numbers to the answer. Compute the z-function for each prefix ( If $$$k$$$ is the beginning of $$$s1$$$ then we should have $$$z[k][i] \gt =i-k$$$ in order to $$$s1=s2$$$ where $$$2i-j+1\leq k \lt i$$$. If $$$x$$$ is the beginning of $$$s5$$$, then we should have $$$z[i][x]\ge j-i$$$ in order to $$$s2+s3=s5+s6$$$ where $$$x$$$ starts from $$$j+1$$$. If we fix $$$i$$$ and we increment $$$j$$$, these two values can be updated in constant time using some precomputations. |
|
0
Can someone please explain how to solve J, H and D? |
|
+39
I also got WA 7 at first because I mishandled the case |
|
0
Auto comment: topic has been updated by cristian1997 (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by cristian1997 (previous revision, new revision, compare). |
|
+5
B? |
| Name |
|---|


