| # | 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 | 158 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 144 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | adamant | 137 |
| 8 | BledDest | 133 |
| 9 | maroonrk | 132 |
| 10 | Proof_by_QED | 131 |
|
+3
Check Div1-500 here. |
|
On
wanbo →
Hackerrank Contest: Accel Hack is coming! Best Prizes ever! MacBook Pro, iPhones, iPads!, 11 years ago
0
It can be solved in linear time using Z-Function. If you have an index i such that Z[i] >= i, this means that the third pattern YYW occurs and the second Y starts at that index. Similarly, if i + Z[i] == string.size(), there is a suffix starts at index i that matches a prefix, which is the second pattern YXY. The first pattern is similar to the third one. Just reverse the string and do the same. Also don't forget to handle the "non-empty" condition. Here is my code. |
|
+13
You can extract the 3rd parameter from the first two to get O(N ^ 2) solution. formula: col2 = ((remainingRows * 2) — col1) / 2; |
|
+3
|
| Name |
|---|


