# | User | Rating |
---|---|---|
1 | tourist | 3857 |
2 | jiangly | 3747 |
3 | orzdevinwang | 3706 |
4 | jqdai0815 | 3682 |
5 | ksun48 | 3591 |
6 | gamegame | 3477 |
7 | Benq | 3468 |
8 | Radewoosh | 3463 |
9 | ecnerwala | 3451 |
10 | heuristica | 3431 |
# | User | Contrib. |
---|---|---|
1 | cry | 166 |
2 | -is-this-fft- | 161 |
3 | Qingyu | 160 |
4 | Dominater069 | 158 |
5 | atcoder_official | 157 |
6 | adamant | 155 |
7 | Um_nik | 151 |
7 | djm03178 | 151 |
9 | luogu_official | 150 |
10 | awoo | 148 |
+57
rabbit |
+39
My solution for D2. First, check the editorial of D1. DP Approach To upgrade the solution, we define the function: $$$\text{sum}(m) = \displaystyle\sum_{i = 1} ^ {m} a_i.$$$ This function can be implemented recursively like this:
It’s clear that when computing $$$a_{2i}$$$ and $$$a_{2i+1}$$$, we only care about whether $$$i$$$ is even or odd and the value of $$$a_i$$$, which effectively reduces the number of states. However, there’s still an issue: the condition $$$i \leq m$$$. We need to know $$$i$$$, right? No, but we need to keep track of some additional information, let $$$br(i)$$$ be the binary repression of $$$i$$$. When transitioning $$$i$$$, we either append a $$$0$$$ or $$$1$$$ to the end of $$$br(i)$$$. If $$$br(i)$$$ is not a prefix of $$$br(m)$$$, the number of transitions becomes fixed, its either $$$|br(m)| - |br(i)|$$$ or $$$|br(m)| - |br(i)| - 1$$$, depending on which is lexicographically greater. Thus, we only need to track $$$i$$$ if $$$i \leq n$$$ or $$$br(i)$$$ is a prefix of $$$br(m)$$$. Otherwise, we only keep track of $$$i \text{ mod } 2$$$ and the remaining number of transitions. The overall complexity is $$$O(n * log(m))$$$ Code
|
+30
As an American-born Chinese, I personally don't believe that my language has any noticeable impact on problem solving, because I don't think in words when I am solving problems (I just visualize everything). Lengths of chains in thoughts definitely impacts your speed in making conclusions. |
+30
Thanks for reviving the craziest and the most fun programming competition format! |
+29
E is, supposedly, well known in romania |
+27
I think this oversimplifies the issue. There are a lot of domains that rely on it beyond economics (statistics, machine learning, data analysis, computer science), but they all tend to do poorly at providing a meaningful intuition for it, especially when it comes to concisely explaining why the solution to the dual is exact solution to the primal, and not just an upper bound. |
+27
If you think this is very advanced hard math, you are greatly mistaken...(although adamant does have maths blogs). Of course, he is not inventing new tricks in all of his blogs, but writing a comprehensive tldr about a non trivial concept (which is no easy task + it is very useful!). Adamant happens to be quite good at doing it. If you're not interested, do not click. Anyway, I didn't read the blog yet but it seems not to talk about extremal points, it could be a good idea for a part 2? |
+26
Solution for M Hint When solving for a given array upto A upto index I the problem of maximum non consecutive sum, then Dp[i] =max(dp[i-1],dp[i-2]+a[i]) Dp[i]>=Dp[i-1] Dp[i-1]>=Dp(i-2) Hence dp[i]-dp[i-1]<=a[i] 0=dp[0]<=dp[1]<=dp[2]<=dp[3].......dp[i-2]<dp[i-1]<=dp[i] after which we will only use max(dp[i], dp[i-1]+a[i+1]) we only need difference of dpi and dpi-1 and we can add the value of dpi-2 to the actual answer. so We will just keep maintain a running difference of dpi-dpi-1. And expected complexity is n*ai code
|
+23
For problem E, a vertex becomes a leaf if it is connected to exactly one edge. But in the editorial, for the third category all the neighbors are being removed. How would the vertex become a leaf with zero edges connected to it? |
+23
Study this. |
+21
Btw A can be solved with $$$4n - 7$$$ votes: 308693499. This can be proven inductively. WLOG, assume $$$m = \binom{n}{2}$$$. The $$$n=2$$$ case is trivial. For $$$n \ge 3$$$, from the inductive hypothesis, say we have a set $$$V$$$ of $$$4n - 11$$$ votes getting the desired facts concerning only the candidates $$$1, 2, \ldots n-1$$$. Now, let $$$S$$$ be the set of candidates who we want to beat $$$n$$$ and $$$T$$$ be the set of candidates who we want to be beaten by $$$n$$$. Let $$$\sigma_S$$$ be any ordering of $$$S$$$ and $$$\sigma_T$$$ be any ordering of $$$T$$$. For $$$2n-6$$$ of the votes from $$$V$$$, make $$$n$$$ the most preferred candidate, and for the remaining $$$2n-5$$$ votes, make $$$n$$$ the least preferred candidate (keeping their ranking among $$${1, 2, \ldots n-1}$$$ the same). Let $$$\hat{\sigma_S}, \hat{\sigma_T}$$$ denote the reverse of $$$\sigma_S, \sigma_T$$$ respectively. Now, we add four more votes, with the following rankings:
Intersetingly, $$$O(n/ \log{n})$$$ votes suffice and are asymptotically optimal. |
+21
Whether it is ugly or not is subjective (I wouldn't post about something I personally find ugly, unless it is about what I think is a nice way to make it less ugly), but in any case what I'm doing is by no means just a copy paste. Yes, often there are papers that describe the same concept as the blog. But I always spend quite some time to figure out what's the best way to present their results, and this often includes e. g. coming up with my own proofs, perspectives and explanations that you wouldn't easily find in papers online, or if you find, it would be difficult to see that this is what they actually mean, because many papers are not very good at articulating their point, or because it is scattered over a few different papers. I of course understand that the way I present material is not the best fit for a lot of people (and you can argue that I'm not good at articulating my blogs in an accessible manner either), but hopefully there are also some like me, who would enjoy my style. I'm not trying to present myself as a great mathematician, and I don't feel like I am. There are people like ecnerwala, Elegia, hos.lyric here, and I can only dream to achieve even a fraction of how good they are at math. In fact, I very often find it difficult for me to understand advanced results, and writing blogs about them is the way to structure them in a way that makes sense for me. For a lot of blogs, I had very little understanding of the subject when I started writing the blog, so the blog itself is a kind of a study diary, and reflects the way I would want it to be presented to myself when I studied the subject. |
+20
Felt the adrenaline rush after submtting I in last 30 seconds. (I used $$$O(n ^ 2 * n !)$$$ bruteforce to get the pattern) |
+20
Problems are nice to stare at, not to solve. Reason My Skill Issue ;-; |
+20
Could you please provide more details?
Thanks! |
+19
Problem C is beautiful |
+19
GOAT is back |
On
george_stelian →
"Adolescent Grigore Moisil" (AGM) International Programming Contest 2025, 44 hours ago
+18
The contest is now also available in the gym. |
+17
non-constructive version of feedback: there are too many boring adhoc problems. |
+17
Use English on an international platform. I want to understand, but I can't because of the language. |
+16
please make others solutions visible to everyone!! |
+16
I think there is a mistake in E's editorial (I might be wrong). In the second category, u and v can share a common neighbour, but we need to calculate the probability that they become leaves whilst also having the common neighbour falls (it can happen that a neighbour of u doesn't fall (other than s) and a neighbour of v doesn't fall (other than s) and s falls and all other neighbours of u and v fall. |
On
Teatify →
An epic level difficulty in computational geometry, I wonder if anyone can provide some idea., 18 hours ago
+16
I think you might be interested in this. |
+15
Alternative solution for B Hint 1 Squares, divided by $$$4$$$, leaves a remainder of either $$$0$$$ or $$$1$$$. Hint 2 $$$2 + 4 + 6 + …$$$ is not square Proof $$$2+4+…+2k = k(k+1)$$$, which cannot be a square. Solution Basically $$$2 + 4 + … + 1 + 3 + …$$$ works. However, if the last even numbers divided by $$$8$$$ gives the remainder of $$$6$$$ or $$$0$$$ then remove it and put it at the back. The first prefix consisting of even numbers is not square by Hint 2. The next prefixes leave a remainder of $$$2$$$ or $$$3$$$ divided by $$$4$$$, so it cannot be square. |
+14
Ohhhhh, super cool that it can be done in $$$O(n/\log n)$$$. This Erdos guy must be strong! We knew about the fact it could be done with $$$O(n)$$$ voters, but we thought it would make the problem harder without really making it more interesting. |
+13
Trying to guess and force a ds on a problem is a big mistake imho. Once you gain enough intuition about a ds, you will be able to "feel" it when you are thinking about the problem. The constraints give you a hint very rarely except when n=~20 or q<=5e4 etc. |
+13
() |
+13
Not in cheating |
+13
I am looking forward to it. |
+13
|
+12
Sure. I think this old article is good https://codeforces.net/blog/entry/53960 |
+11
If you can solve either of your 2 problems, then you can use it as a block box for binary search to solve the other with an extra log factor. Also, have you done many problems with "digit dp"? That can be used to solve the first problem. Your state can be encoded by (I) current digit, (II) previous digit, (III) is the number you are constructing guaranteed to be less than I think this doesn't sound that fun to implement (digit dp never really is), and needs special handling for leading 0's, and for the first and last digits. But, it should work. |
+11
First, you binary search on the answer. If no value of $$$G$$$ works then the answer is $$$-1$$$. If a high enough value of $$$G$$$ works (say, $$$10^9 + 1$$$ works) then the answer is infinity. So to check if a value of $$$G$$$ works, you want to find the longest subsequence $$$a$$$ in the given array where $$$a[i]−a[i−1]\geq G$$$ after assigning values to all of the $$$−1$$$ elements. You need to check if this subsequence has length at least $$$k$$$. It is optimal to use as many $$$−1$$$ elements in the given array as possible. If you let $$$a[i]$$$ and $$$a[j]$$$ be immediately after eachother in the subsequence and you skip some $$$−1$$$ elements in the subarray $$$a[i+1, j−1]$$$, then you can replace one of $$$a[i]$$$ or $$$a[j]$$$ with a $$$−1$$$. Now, let $$$dp[i]$$$ be the maximum length of a subsequence ending at $$$i$$$, where $$$a[i]$$$ is not $$$−1$$$. Let $$$p[i]$$$ be the number of $$$−1$$$ elements in the prefix $$$i$$$. From our observation, you only jump from $$$i$$$ to $$$j$$$ where $$$a[i]+G(p[j]−p[i]+1) \leq a[j]$$$, so $$$a[i]−p[i]∗G+G\leq a[j]−p[j]∗G$$$. You set $$$dp[i]=\max(dp[i],dp[j]+p[j]−p[i]+1)$$$ for all such j. This transition is easy to optimize with a segment tree |
+11
Reminder: The contest will start in five hours! |
+11
Who knows, but there have definitely been fewer contests recently. |
+10
It's from the first contest of the 2022 TST ("Lot") |
+10
H when the distances are the same. https://atcoder.jp/contests/abc135/tasks/abc135_e |
+10
Interestingly, I came up with pretty much same problem as D. Morse Code for another contest some years ago, it got rejected (reason: it appeared in some shortlist very long time ago, $$$O(N^4)$$$ intended solution IIRC) Later I discovered $$$O(N^2)$$$ solution in a paper. |
+10
I think an easier way to get to $$$O(n)$$$ votes (specifically, $$$2n$$$) is to just color the edges of the graph with $$$n$$$ colors (according to $$$(a+b)\pmod n$$$), and then for each color process all the edges of that color simultaneously. |
+10
After floyd-warshal, the path with the minimum distance between 2 different pairs of vertices could include the same edge of the orignal graph. Countercase
Expected output: |
+9
I think the aspects of language that may affect problem-solving skills is (1) the "flexibility" of the grammar; and (2) how easy it is to coin field-specific "vernacular" words. For (1), the word order and the sentence structure in the Chinese language is quite flexible, so Chinese speakers can easily put random words that come into their mind into one sentence without adjusting the word order. For (2), Chinese people in a specific field often create terms for convenience that are not standard Chinese, should not be used in formal writing, but are acceptable in a specific academic community. Examples include:
However, it is always important to know that language, as well as anything else, is not the decisive factor that can dictate how well people do something. A lot of factors can contribute to academic performance, and even the language itself can be creatively changed if you want to. |
+9
Chinese start with C and Coder start with C |
+9
Thanks for catching this mistake, exactly one of the neighbours must not fall. Fixed. |
+8
Now I understand! Thanks for the explanation. |
+8
For problem C you could also root the three at 1 find with a dfs where et is,then mark all subtrees that contain that node. Then we will use the following algorithm: ->we start in 1 we go in subtrees that do not contain the searched node when we reach a leaf we put that node and go back when we finished visiting subtrees that do not contain the node we are searching we are appending our node to the operations and go in the subtree that contains our searched node if it exists This is my code that gets accepted:https://codeforces.net/contest/2071/submission/308395204 |
+8
dear all coordinator Sugar_fan this guy arnabmanna cheated in Codeforces Round 1007 (Div. 2) and got rank 11..he is now candidate master..i urge all coordiantor to look in this matter. for more details look at this blogs: https://codeforces.net/blog/entry/140217 his previous account Arnab_4 |
+8
You're absolutely right, fixed. |
+8
My guess is that rounds are coordinated based on the individual problemsetter / coordinator's preference, and are mostly done independently, with an exception to ensure that two contests don't run on the same day. |
+8
yet another goated blog post from lrvideckis |
+8
In the solution of problem E in order to calculate contribution2(u, v) you separate it to two cases: when u and v share a neighbor s,
In the editorial, the value for the second case (2.) is However, $$$(1 - fall_{s})$$$ implies that s is not removed from the tree. Should this not be $$$fall_{s}$$$ instead? Thus, I think (2.) should be given by |
+7
Arpa If i can see what thought process one goes through while solving problem and it can be in structured manner like you can solve the question and later explain in video that's what your thought process was throughout and various conceptual learning that may be involved in problem. Thank you a lot for putting in so much efforts.. |
+7
I don't enjoy your judged problems; they don't feel exciting to me. It seems like you are trying to make thinking-oriented ad-hoc problems (similar to Atcoder or NEERC regional ones). But it looks unnatural, like forced in some way so that problems become more ad-hoc. It's not like I don't enjoy such problems (they're one of my favorites), but I don't know. The joy of such problems is that they are natural, that you get an AHA moment. From your problems, I don't feel it. |
+7
(x+1)^2≤y^2 in problem B shouldn't it be ? (x+1)^2 > y^2 |
+7
|
+6
Thats very interesting you visualise everything. But, I wonder how. For me syllogism-like, “if this -> then this” verbal chains are the heaviest part of how it works for me. So much so that articulation is impossible to bypass for me. If I consider the Div2A from round 1007 for a simple example. Someone that has language heavy approach would think literally in a “verbal stream” like so: Spoiler “if x and y were in the (wlog) present match and x won, then irrespective of whether x wins or loses next time, he goes out. Which means x is already guaranteed sitting outside in match 3. This means, the original z can spectate again only in the 4th match. Oh, but since z also played second match, he must sit out after the third match, which means not only he can but he must be a spectator in 4th match.” For you is it like, your primary response is literally seeing three objects rotating around in a cyclic fashion. I’d like to hear a bit more about how the visual path to the same result looks like ? (ofc a bit too much overanalysis for a div2A, but does help to keep the focus on meta aspects) |
+6
This reminds of Obama meme for a reason XD |
+6
You, yourself, said "many"; you didn't mention codeforces. Think of it like that, if everyone post blogs for their communities, we will have Spanish, Italian, German, Japanese, Chinese, ...., etc blogs, and at this point, the blog section won't ever be accessible to all the users. I didn't say the blog content should relate to everyone; I just said the language. And it makes sense that the language of the blog section should always be in English. (Unless it's the Russian version of codeforces.) |
+6
environment matters more. examples:
|
+6
Fixed, thanks! |
+5
It's dense, but not the densest. Vietnamese is denser.
I can tell you why. Unlike in Chinese, a Chinese character in the Japanese language usually corresponds to more than one syllables. In fact Japanese is famous for being "sparse" instead of "dense", and that's why syllables are uttered very fast when the language is spoken.
I can't find anything in common in the three languages. And Russian words are generally long.
No one thinks about how words are written when they think. |
+5
BiggestOtaku noice i thought about pattern recognition and was doing this before announcement in constraints like subaarays size >= 2 and after that i fell asleep.. Congrats!! |
+5
Not a formal way to put it, but there aren’t that many squares. |
Do you need to know that recently jiangly received a higher score than Tourist? Did Mike intentionally do it? What's the point? Tourist has won the IOI championship and World Final championship many times in a row, which is just jealousy among many people. However, these ridiculous rumors cannot change the fact that Tourist is a programming Legendary Grandmaster. |
+5
The difficulty level of the first four questions and the last three questions is a bit high, TT,Does anyone think like me that the color of Specialist is the best among all levels. |
+5
Thank you! |
On
Teatify →
An epic level difficulty in computational geometry, I wonder if anyone can provide some idea., 10 hours ago
+5
Wow, this looks more like a pure geometry problem. I think this is very rare in computational geometry for algorithm competitions. I was already interested in Euclidean geometry before playing Codeforces. Let me think about how to implement this algorithm? The platform you provided is very good, and I should thank you well no matter what~ |
+5
I didn't have much fun today, but when I saw this blog post, I was immediately amused. Thank you, Joker~ |
+5
It doesn't mention them directly, but it should be kind of clear that supporting hyperplane should touch the feasible set at some extremal points? And maybe less clear, but still useful, that at the extremal point, you can represent the normal vector of any supporting hyperplane as a conic combination of the normal vectors of the faces that touch the point. But I'm not sure what exactly could be said about them beyond that... |
+5
Therefore, $$$(x+1)^2 \leq y^2$$$. However, the sum of integers up to $$$k+1$$$ cannot be a perfect square because this will lead to a contradiction $$$(x+1)^2 > y^2$$$ |
+4
Suppose the digits of a k-digit safe number are $$$a_1, a_2, ...,a_k (0 \le a_i \le 9)$$$ from left to right. Let $$$t$$$ be the first position where $$$a_t \le a_{t+1}$$$ (let $$$t=k$$$ if the sequence $$$a$$$ is monotonically decreasing). Thus by definition of $$$t$$$, $$$\forall 1 \le i < t$$$, $$$a_i > a_{i+1}$$$, which indicates $$$a_1 > a_2 > ... > a_{t}$$$. As we know $$$a_t \le a_{t+1}$$$ and $$$a_{t+1} < \frac{1}{2}(a_t+a_{t+2})$$$, then $$$a_{t+2} > a_{t+1}$$$. Since $$$a_{t+2} > a_{t+1}$$$ and $$$a_{t+2} < \frac{1}{2}(a_{t+1}+a_{t+3})$$$, then $$$a_{t+3} > a_{t+2}$$$. By an easy induction we know $$$a_{t+1} < a_{t+2} < ... < a_{k}$$$. As a result, we conclude that, the sequence $$$a$$$ must be a monotonically strictly decreasing sequence concatenated by a monotonically strictly increasing sequence (the length of both can be 0). The number of monotonically strictly decreasing sequences is no more than $$$2^{10}$$$, because you can freely choose whether or not to include each digit 0-9 and then sort them to form such a sequence. For the same reason, the number of monotonically strictly increasing sequences is no more than $$$2^{10}$$$. Finally, we can pre-compute all such sequences and use brute force to combine each pair of decreasing and increasing sequences and check whether or not their concatenation is a safe number. Then we get the full list of all safe numbers whose length is no more than $$$2^{10}*2^{10}=2^{20} \approx 10^6$$$ (which is in fact far less than this bound), and answering both your questions is easy. The total number of operations is $$$O(2^{2d}*d)$$$, where $$$O(2^{2d})$$$ is for brute-force concatenation, and $$$O(d)$$$ is for checking whether or not the concatenation is a safe number. $$$d=10$$$ is the base of the number system we use here. |
+4
Lmao, you got banned ahahahaha |
+4
As an author I can assure you of intresting problems. |
+4
wtf it is My eyes are injured now |
+4
ne znau |
+3
Very good problems! They are not too hard to solve but require a little creative thinking. But I can't solve problem G at all... |
+3
Solve problems in your rating or above by 100->200 and if some problem needs a topic that you don't know , then that's a sign that you should learn this topic.. Anyway reaching expert doesn't need many topics but DP and Binary search and some standard topics. |
+3
L can also be solved via randomised solution, taking 30 random vertices is more than enough |
+3
Yeah we were aware of that and was allowed to pass as well. |
+3
As an author , enjoy my $$$2_{nd}$$$ round on KEP |
+3
Really excited for the contest... |
+3
Don't trust him—he's a cheater. Just check his first contest; he ranked around 250 and solved 7 problems, which is a clear red flag. Haha. I downvoted his blog and hope he gets banned. Don't upvote the wrong person! |
On
The.Rizzler →
Cheaters in the last round just braindead copied an unneeded type cast, 25 hours ago
+3
tuamitk42 has same submission |
+3
I have a probabilistic solution for Problem A (optimised) https://codeforces.net/contest/2068/submission/308681793 |
+3
I have a probabilistic solution for Problem A (optimised) https://codeforces.net/contest/2068/submission/308681793 |
+3
ya the initial one i got tons of wrong answers as well, had to do random shuffle for the adjacency list of all the numbers as well and then half of the times put the array in the front and the other half of the times at the back of the permutation. Ya probabilistic solutions are always fun. |
+3
We maybe not be paying anything directly but this platform is meant for us. And so we have the right to question or ask the authors or share our opinions about various aspects involving it. |
+3
Auto comment: topic has been updated by mostafa.saad.fci (previous revision, new revision, compare). |
+3
when will the result of first round be declared and where...? |
+3
Yes, and it's fine to provide a good rationale outside of geometry. Well, the issue here is, I spent 3 hours yesterday trying to understand how economist perspective on LP dual works. And while the economist explanation I was given for primal problem makes total sense, the explanation for dual felt very stretched and unnatural (even from economics POV), and left it unclear why the result would be the exact match with the primal, rather than just an upper bound. It could as well be that it is an issue with the particular version of the explanation (although I think they're all similar to it), but even then it kind of strengthens the point that most explanations used in courses, etc, fail to convey it clearly enough, even within their context. |
+3
It was an amazing contest .. Thanks for the authors <3 |
+3
Hacked and added the test. Thank you! |
+3
Thanks,Great job, Ibrahim. Making it to the top 10 is no small feat—well done . Looking forward to seeing you crush it in the next contests |
+2
Wow, this is going to be very interesting. |
+2
So that the retards cannot spam all the time and make this community looks bad |
+2
Ohh great... |
On
Teatify →
An epic level difficulty in computational geometry, I wonder if anyone can provide some idea., 8 hours ago
+2
Of course, I am responsible for the computational geometry part of our team. I have seen many interesting problems, but I believe that thinking is still very important. There is a master named Crimson231 on QOJ, and you can take a look at the difficulty of the computational geometry problems he solves on OvO |
+2
CF predictor's plan |
+1
Step 1: Don't try to cheat to reach a new color; Step 2 : Step 1 Step 3 : Step 1 Step 4 : solve problems rated [your rating, your rating + 200] and focus on standard topics like : {binary search, greedy, two pointers} |
+1
I agree..even 3 hrs back i expose him..he is cheating for very long time..earlier he got rank 1 in leetcode contest.then lc ban him.now he cheated here..these type of people just ruining the CP contest.i request cry please ban him immediately |
+1
cry had nothing to do with this round. I'm not 100% familiar with how this works, but my guess would be to inform the contest coordinator, Sugar_fan |
Name |
---|