| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | adamant | 152 |
| 3 | Proof_by_QED | 146 |
| 3 | Um_nik | 146 |
| 5 | Dominater069 | 144 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
|
On
Not-Afraid →
Hack my solution which uses Rolling Hash for Cses problem "Finding Periods", 5 years ago
0
Yes, it is a possible to solve this using KMP: Link to code: https://cses.fi/paste/91785ee2b5f0dd262517f4/ HINT: Spoiler With some pre-computation, in O(1), you should be able to check if a prefix of length 'i' is a suffix (not necessary longest length which KMP tracks by default) of the string ending at position 'j'. Then, for a prefix of length 'i', you can traverse through the entire string and see if is one of the periods in (n/i) iterations. Overall: (n/1) + (n/2)+(n/3)+..+(n/n) leads to O(n log n) |
|
0
For 1385F - Removing Leaves, there exists a O(n) solution based on rerooting of trees concept. Check this out : 87161106 |
|
+2
I know, I haven't used that. Apparently,the mistake is overflowing of the product. Thanks anyway. |
|
0
What is wrong in this : Try to take even number of negative numbers starting from descending order and multiply with even numbers left , again in descending order. If the above is not possible, then check if a zero exists. If a zero exists, ans is zero else answer has to be negative. SO, try to take odd number of negative numbers in ascending order and choose remaining numbers as even, again in ascending order ? |
|
0
|
|
0
In code of part 2, it says Can someone explain how subtracting is synonymous to XOR here ? Is this an error ? |
|
+3
|
|
+3
Thanks for pointing it out galen_colin I have fixed it but still gives wrong answer. Any ideas ?? |
|
0
Can someone help me to figure out what is wrong with my solution for E ? https://atcoder.jp/contests/abc168/submissions/13345624 My logic is almost similar to the one given by galen_colin but is failing from test cases 11 to 19 . I am dividing coordinates (a,b after dividing by gcd) to 3 cases: 1)Origin(0,0) 2)either on x-axis or on y-axis but not origin 3)Neither of the above |
|
0
Yeah, you are right. I overlooked the directed part. Any efficient algorithm for answering queries then ? |
|
0
So, if there are several queries, you can add the inputted edge between two vertices only if they are of same colour. By this way, your graph should break into several connected components and for each query, you just need to check if the two vertices 'u' and 'v' are connected to at least one common connected component in the original graph. |
|
0
Bit of an overkill but problem 1 of this blog may be helpful |
|
+3
Intuition is incorrect, For n=4, {1000,1,2,2000}, your algorithm will fail. |
|
0
For question D:https://mirror.codeforces.com/contest/706/problem/D Can someone explain logic behind this submission https://mirror.codeforces.com/contest/706/submission/19826426 ? It seems extremely simplistic and doesn't seem to use tries. |
|
0
What is subcase 136 in pretest 2 ? |
| Name |
|---|


