| # | 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 | Um_nik | 146 |
| 4 | Dominater069 | 144 |
| 5 | errorgorn | 141 |
| 6 | cry | 139 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
|
0
Depends on how you're calculating Y. You need to be careful about the case when the king is already on (1,1). |
|
+13
Like milk lol. |
|
0
Is that not the intended solution? If so, is there any other solution? |
|
+18
For C, I have a stack solution that should hopefully work in O(N). Solution — https://mirror.codeforces.com/contest/1556/submission/127374965 The idea is that you keep track of open bracket sequences and completed ones in a stack and update accordingly. It works in O(N) because each value either adds a new entry in the stack or deletes a few. |
|
+47
But if the code will not be re-run, how will you know it's wrong? |
|
+1
Yeah, I can barely make it to the 5th or 6th problem with enough time in a 2hr contest. I used to like Topcoder SRMs for this reason because one can actually get to the harder/nicer problems in time since there are only 3 problems. But i guess I'm digressing here, I'll give it a try when i find time to upsolve. Thanks. |
|
+10
Sure it is, but so are puzzles. None of these problems involved programming or designing a data structure or an algorithm I'd say. I'm not saying these problems are bad, but it's nice to have a variety in contest problems. There is so much possible with graph/tree, DP, DataStructures, geometry, string algos. So it's a little disheartening to see the first 4 problems just being ad-hoc. |
|
+16
Every other problem is casework lol. Nothing to learn from the first 4 problems. |
|
0
vovuh Sorry for the ping! But since you prepared this problem, I was wondering if you had some ideas on this? I would suppose you gave this version some thought and then added the constraint to make the problem easier. Would appreciate your input. Thanks. |
|
+12
Back to back segtree problems for the past 3 rounds. |
|
0
Can anyone explain the thought process of reducing problem F from 2^(2n+2) to 2^(n+2) if one is following the basic inclusion-exclusion process? |
|
+4
Yeah, like why use the word "die" in the statement. I missed the part where they are resurrected and all friendships restored. Wasted an hour trying to see what is wrong. Could've been much clearer with a better wording. |
|
+28
If Let's say we can pick Also note that, any 2 selected nodes will have LCA equal to centre (meaning any path from one selected node to the other must go through centre, otherwise their distance will become shorter). What this means is that from the subtree of each child of Do dfs from each child of X and for a height h, let's say there are Looping over the root node X and height H and then solving the dp for each such combination yields the final result. You can look at my code, but my implementation is a bit messy with some extra code. |
|
0
tourist Any updates on the editorial for the problems F,G,H? |
|
0
Thanks. Unfortunately thought of at the last minute so no AC. But i'm glad you liked the solution. |
|
0
For any prime p at appears in a[i] (ie, a[i]%p = 0) ,if p appears in a[i+1] too, then continousLen[p]++. Else contiuousLen[p] = 1. This way you don't have to look at all the primes, but only those that are appearing in the number a[i]. We also update the maxLen over such primes only. Consider this similar to lazy updates. So this should effectively pass in the the TL. This would be O(N * |max number of primes in one number|) Does this make sense? |
|
0
I think I might be the only one with a non-binary search and non-segtree approach for F. Could not get AC so I'm not even sure if it's the right approach.
I couldn't get AC in time, but does the approach sound correct? |
|
0
Was the TL for E2 really tight? My O(N) soln kept giving TLE on case 12. https://mirror.codeforces.com/contest/1537/submission/119909827 |
|
0
Thankyou so much for taking out the time to look into this and getting back to regarding the issue. I definitely learnt something new today. I understand why this happened now. Have a nice day :) |
|
0
https://mirror.codeforces.com/contest/1534/submission/119394653 Can somebody try this out on their machine. I submitted this in contest and it gave WA on pretest-1 and i tried it on my machine multiple times and it worked well. I'm really frustrated as I don't understand how the same code in 2 machines can give different output (my strategy isn't random, the program will always query the same nodes for a particular tree everytime it runs). |
|
0
https://mirror.codeforces.com/contest/1534/submission/119394653 — This same case passes in my machine in 2 queries, i tried multiple other cases too. But CF says here it took more than 2 queries. Did i miss something here? |
|
+5
Thanks! I hope so too. I aim to reach Div1 sometime in the next few months. Let's see how it goes. |
|
+2
Sorry I'm getting back to CF after many years and now I see there is also a Div3. Will this round also be rated for Div3 folks? |
|
0
It's still wrong even if both accounts are yours, you are essentially bypassing all the WA penalties. How do you expect CF to know which account belongs to which human on earth. If 2 accounts use the same solution, they should be penalised. |
|
0
You can check my solution, but the idea is that you can sort the array and process it in order of increasing a[i]. Now you need to solve how many pairs are such that a[i] + a[j] <= X. If you start from the smallest a[i], all the numbers <= X — a[i] will be valid pairs. As you move to the next i, a[i] will increase, and the numbers <= X — a[i] will only decrease so you can use a pointer. |
|
+8
You can also use a 2 pointer approach. |
|
+24
Wow, this was such a fun read. Thanks for putting in the effort with the diagrams and thought-process. |
| Name |
|---|


