| # | User | Rating |
|---|---|---|
| 1 | Benq | 3857 |
| 2 | jiangly | 3810 |
| 3 | maroonrk | 3534 |
| 4 | tourist | 3528 |
| 5 | Kevin114514 | 3510 |
| 6 | turmax | 3411 |
| 7 | Um_nik | 3387 |
| 8 | Radewoosh | 3367 |
| 9 | heuristica | 3322 |
| 10 | strapple | 3317 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | maspy | 150 |
| 3 | Um_nik | 146 |
| 4 | Errichto | 139 |
| 5 | adamant | 136 |
| 6 | maroonrk | 134 |
| 7 | DNR | 133 |
| 8 | nik_exists | 132 |
| 9 | Dominater069 | 131 |
| 10 | Proof_by_QED | 130 |
|
0
Consider this case,A[7 8 9 4 5 6], B[3],the leftmost element is 7,but you need to insert 3 after 4, not after 7. Also, the nlogn solution gives you same result in each step as n^2 solution, not only the final lis length. You can find this point by comparing these two solutions in each step. |
|
0
Great idea, but it needs to be fixed. Consider this case: A:2 2 3 4 B:1 if you insert 1 after the first 2,the result will not be best. About your question, simple dp runs in O(n^2) and there exists a binary search trick to make it O(nlogn) . |
|
0
No need to run a multisource BFS, because we have 256 different initial states a0,a1...a255, and for each node x can be reached by at most one initial state. So BFS 256 times is also correct in complexity. |
|
0
It's quite interesting, and I figured out only when min(u,v)==gcd(u,v) can edge(u,v) be useful. So the number of edges is not big. |
|
0
Hello! The same character can appear many times and make many sub-strings whose answer for the 2nd query is 2. So your number of 1st query may be very large. |
| Name |
|---|


