+141
New fear unlocked |
+93
Come on... releasing the checker and some tests after 10 days of the competition? +Extension I did most of the work in the first week, and planned to do very little this week. Good luck with that plan now, right? |
+85
Almost toughest Div2. BCD are too hard for their positions and D is the strangest problem of my CP journey... |
+75
meanwhile you are just a troll with no life |
+70
They brought guns to a fist fight. |
+63
It was the most fun Div.2 ever, thank you! |
+55
Guess why |
+49
Very nice round! |
+45
Stop replying with your alts then we can talk |
+44
This is a huge insult. I'm sure I'm not the only one who agrees with. I don't know if I'm qualified to say this, but can't you be kind to other? Can't you at least be kind enough to not be sarcastic or insult someone who has nothing to do with you and has raised a legitimate issue? |
+43
United Kingdom's team:
|
+41
Is the checker numerically stable? Will it always add the same numbers to the same value? I locally got a situation where printing extra stuff in the checker changes the sum that it computes. Maybe that's allowed in C++. I also created a test where |
+40
as another participant I don't think this is a wise decision. If you don't attempt harder interactive problems you will not improve at them. |
+40
Glad the guy finally got served. Never have anything nice to say, just stupid insults and 4chan rhetorics |
+37
Why? |
+36
at uni |
+35
Spain's IOI team is:
|
+35
Dyslexic Sparse University of Tartaria |
+33
Here is the brazilian team:
Good luck guys :D |
+30
Happy birthday! I hope you will enjoy the round :D |
+27
wait your legendary Aidar Munduzbaev has no attemts left? Sad that he couldnt get gold |
+27
Orz! It seems that people use the rolling hash formula $$$\sum_{j = 0}^{n - 1} q^{n - 1 - j} s_j$$$ more frequently than $$$\sum_{j = 0}^{n - 1} q^{j} s_j$$$. Probably it would be better to have an "reverse the result" option. |
+26
thank you blog that man good put like for him |
+26
My idea for C is slightly different and imo cleaner. Its also much easier to prove why my idea actually works. Here's my code: 261430375 The explanation Incase I explained something poorly, please let me know! And I'll try to help if I can. :D |
+25
Italy:
|
+25
Well, it's added. |
+25
|
+23
Expected sum is not always exact. It is calculated by Kahan summation as in the published checker implementation. |
+23
Lol I thought I was the only one thinking B was odd. Counting prefixes bit-by-bit should be C at least. |
+22
I messed up guys. It was 7 and I wasn't been able to sleep yet. I decided to go to uni right away. Next frame, it was 12! I have no idea what happened since I even had my alarms on for 8. I hope we'll have a chance to do this another time. Feel free to downvote this comment. I messed up and deserve that. |
+22
Spoiler |
+21
Plz.start on 17:05(UTC+08) :< |
+21
what is dsu |
+21
We have only 11 grades in Kyrgyzstan and I went to school one year early. So yeah, last year was my last chance, despite me being 17 right now. However, this year I will hopefully be in Kyrgyz IOI delegation and help out guys to get the first gold for Kyrgyzstan. Good luck to contestants from all countries. |
+21
Receiving clarifications for A about 7-9 mins into the contest after 1 failed attempt to answer the "original" problem is pretty underwhelming. Bonus points for MASSIVE confusion after the first submission failed on pretest 1. |
+20
This never happens again. But, definitely, I will share the channel with them. |
+20
Congratulations prvocislo, looking forward to your round :D |
+20
Out of curiosity, what makes D so strange in your opinion? It feels fairly normal for a CF interactive problem to me. |
+20
Finally i have reached master |
+19
I tried my best to divide the solution into reasonable parts, hopefully it'd be helpful. init calc_f P.S: It appears that there are some similarities between my sol and the sol above, which wasn't there when I started writing the comment. |
+19
I don't know man, telling someone is right after he called you effeminate is just a little weird |
+19
It was very easy to implement, the observation was the difficult part imo. |
+19
Find the maximum element $$$mx$$$ in $$$a$$$ by making queries $$$(1,n*n), (1,n*(n-1)),\dots$$$. If you get $$$r=n$$$ on query $$$(1,n*b)$$$ then $$$mx=b$$$. Now since this maximum element is present in at least one of the $$$k$$$ subarrays, $$$mx$$$ must divide $$$m$$$. Also, if $$$m=b*mx$$$, every subarray must have length at least $$$b$$$. So we only need to check multiples of $$$mx$$$ upto $$$\frac{n}{k}mx$$$. In each candidate for $$$m$$$, just query $$$k$$$ segments starting from position $$$1$$$ and check if these segments cover the array. This takes $$$n$$$ queries to find $$$mx$$$ and another $$$n$$$ queries to check all values of $$$m$$$. |
+19
prvocislo orz <3 |
+17
Please no GOD no please. I won't play Genshin any more. Please don't hack my Hash. |
+16
← Anonymous Tester |
+16
no it is created by Sergey Kolodyazhnyy |
+15
shayan is awol lol |
+15
How can I murder someone as inconspicuously as possible |
+15
Honestly, it doesn't matter. There is simply no reason why you should defend the guy. |
+15
Anyone proved the validity of C? I thought of a greedy solution, check if it's possible to maximize at indices $$$(3, 5, \dots, n-1)$$$ or $$$(2, 4, \dots, n-2)$$$, then take the case with better score. |
+15
The interaction and the output format is very weird. What I expected: I can ask $$$l, r$$$ and the answer will be $$$f(l, r)$$$. (I know that's not interesting because $$$f(l, l)=$$$ $$$a_l$$$) And the output should be the array or some natural proterty of that. By the way nice problem. |
+15
I appreciate it broski but I have also done a lot of leetcode so, between the two platforms, it is normal growth. I think that leetcode is better than codeforces when you are beginning 100%. |
+15
Wow rating changes and editorial were kinda fast... speedforces |
+14
Marinush His comments are more useful for the community than your retarded post and comments. It is you who needs to chill. Also, you don't need to write your username in your every fucking comment. We can see your username with our own eyes. We are not blind either |
+14
I'll win. |
+14
|
+14
In my opinion, leetcode is the best way to start competitive programming because it introduces the most common competitive programming concepts (greedy, binary search, dp, graphs/trees, etc etc) through more or less straightforward problems. The good thing about this is that you aren't gonna have to do some weird math things while solving leetcode dp problems, for example. You can just focus on learning dp. Another benefit of leetcode is that it has a much bigger community than cf. If you get stuck on a problem, you will have much more than just a single editorial to read. There are videos, writeups, and there is even a solutions tab that you can use to understand the problem. If I were you, I'd go to https://neetcode.io/roadmap and just start working through that list. NeetCode, the guy who made that website, has great explanations for each problem. Once you finish that list, start doing random mediums, and when you feel comfortable with those, start trying some hards. When I was grinding out mediums, I'd try to limit myself to 45 minutes and then I'd look at the solution. Make sure you're doing the weekly and biweekly contests while you're practicing. Once you reach a 2000+ rating, I'd say that you should start practicing on some more serious competitive programming websites. 2000 rating should get you to specialist on codeforces at least. |
+13
My clar few days ago: ... then, finding the exact sum with Kahan's algorithm is contradict with this answer, but will the checker fixed? |
+13
Proud of myself by solving C with proving its validity, not by guessing |
+13
Solving a 1600 rated problem in your first contest is considered division 5? |
+13
any random things like selling solutions can happen. We shouldn't presume guilt, but he had already cheated. |
+12
TimDee has neither silver medal nor girlfriend |
+11
wasn't eolymp created by medv? |
+11
First, we can make $$$4$$$ arrays $$$gr, gl, sr, sl$$$ which stores for index $$$i$$$, what's the nearest greater value to the right, to left and smaller value to left and to right. This can be done using stack in $$$O(n)$$$. Now, let's consider the edges (there is an edge between $$$(i, j)$$$ if we can go from $$$i$$$ to $$$j$$$ in $$$1$$$ move i.e all elements in between are between $$$a_i$$$, $$$a_j$$$). Important thing to notice is that, we will take the edge which brings us closest to $$$r$$$ (considering the query $$$(l, r)$$$). Also, another observation is that it is easily determinable that whether $$$a_i$$$ is a min-point or max-point. We can just check that whether $$$a_{i + 1}$$$ is less or greater than $$$a_i$$$ and then we can't have $$$a_i$$$ as min if $$$a_{i + 1}$$$ is less than it (similar for other case). Assume that $$$a_i < a_{i + 1}$$$ since other case is similar. Now, $$$a_i$$$ is min and we want the max points. Note that the edges from $$$i$$$ are going to the changes in the max as we go towards right from $$$i$$$. Now, where will the last edge be? It will be to the maximum in the valid range. What is a valid range? the range will be valid such that the min point $$$i$$$ does not change. So, beyond $$$sr_i$$$ (the first index to the right of $$$i$$$ which have smaller value than $$$a_i$$$)we don't have any edge outgoing from $$$i$$$. So, we just get the max in the range $$$[i, sr_i)$$$. Now, we have $$$O(n)$$$ edges added in $$$O(n \space lg(n))$$$. We can also do binary lifting and store where do I land when I take $$$2^x$$$ edges. Now, when the query comes, we just go to the rightmost point we can from $$$l$$$ which is $$$\leq r$$$. What to do after that? We can now just do the same things we did for going in the right direction, for the left direction. Now, we starting going left from $$$r$$$ (using binary lifting). And we want the minimum jumps needed to get $$$r \leq l$$$. Now, we add both of the steps and we are done. Proofs of the observations are not hard, I believe that you should try them. Implementation |
+11
thanks for the great contest! i really liked problem H. |
+11
It’s down now. What happened? |
+11
can you do a blog edu about binary tree on segment search in O(nlog) compilation time ? |
+11
sorry I meant binary search on tree segment |
+11
r/wooosh |
+11
If I was there, I would surely ask Bill why they allow for such discrimination in ACPC. Can someone please do it for me? |
+11
As long as $$$1$$$ is not one of the chosen elements to be local maximums, then such construction will lead to values $$$\geq n+2$$$ for local maximums and $$$\leq n+1$$$ for other values. |
+11
A: I guessed we should greedily remove (1, 1) from 2 highest score until there is 0/1 positive score left. B: I guessed it's binary searchable. C: I guessed only considering position 2 and 3 is sufficient. D: What should I guess? XD |
+11
Thank's! will see the hint after AC :) |
+11
Is it just me who solve A with a naive dp? Can't even come up with any solutions now xD |
+10
This blog became more of an orz warks profile review than AMA! |
+10
|
+10
When you die, would you rather not exist at all or have a 99% chance of going to heaven and a 1% chance of going to hell for eternity? |
+10
|
+10
I ended up coming up with the editorial solution and another in the contest, so I'll describe them both: Editorial Intuition We suppose $$$n$$$ has odd index and then try to make all odd elements into peaks. Is it possible? The worst case might be when $$$1, 2, 3 ... n/2-1, n$$$ are the elements in the odd positions and $$$n/2, n/2+1, ... n-1$$$ are the elements in the even positions. We can even go further and assume $$$n-1$$$ is next to $$$1$$$ and $$$2$$$, and $$$n-2$$$ next to $$$2$$$ and $$$3$$$ and so on. Obviously let's assign smaller labels to the ones in the even position and larger labels to the ones in the odd positions. Well $$$n-1$$$ gets the label $$$1$$$, so $$$1$$$ and $$$2$$$ need the labels $$$n$$$ and $$$n-1$$$ respectively, and then continuing in this way we can make the observation that you call counter-intuitive. My Intuition We can construct $$$q$$$ so that all the $$$a_i$$$ are equal (make $$$q_i + p_i = n+1$$$). Now we want to reorder some elements of $$$q$$$ such that all the odd/even elements become peaks. Since all elements of $$$a_i$$$ are equal at this point, we just need to reorder the elements of $$$q$$$ so that the ones in odd indices increase, and the ones in even indices decrease (or vice versa). There's a lot of ways to do this, the first one that came to my mind is just suppose that $$$n$$$ appears at an even index $$$2k$$$ and sort the odd indices in increasing order of value. Then do $$$q_{o_1} \rightarrow q_{o_2} \rightarrow q_{o_3} \dots \rightarrow q_{2k} \rightarrow q_{o_1}$$$. i.e. the smallest odd index gets value of the next larger odd index, etc. and the largest odd index gets the value of n. |
+10
I hacked it with the obvious test case. You got lucky with weak system tests. |
+9
You can write contest from only one account and you can only have 1 account. |
+9
You create a vector of size 1e6 every test case. Since the number of the test cases may be up to 1e4, your code leads to TLE. |
+9
interesting bro. ples publish mor content |
+9
So you are proud of being a troll with no life? |
+8
As a contestant, qwerasdfzxcl is handsome |
+8
I believe priority queue is better as it uses heap instead of a balanced BST, which makes it better in terms of time complexity(better as avl rotations have higher constant factor than extract max of heap) and space complexity(no need of pointer to left and right child as would have been needed in balanced tree for set). |
+8
Fuck it, it is 5:30 over here, we have to start in 3 hours and I couldn't sleep yet. I don't understand what is going on. I hope you haven't poisoned me guys. |
+8
Ice_man2.0 will win EJOI |
+8
I found the problem. It was on the 48-th line, because $$$j$$$ could be negative, which led to negative indexing. |
+8
In my humble opinion, these recent announcements are not entirely fair to those individuals in top positions, as they were clever enough to unravel the hidden aspects of the contest unaided. Now, they may face additional competition for the top spots. While such adjustments might be acceptable in a 'just for fun' contest, they seem unjustified here, especially considering the significant monetary stakes involved. Fear not, top performers! I pose no threat to you! I currently reside at the bottom of the leaderboard and intend to stay there for the duration of the competition. :) Good luck! |
+8
idk it sounds cool |
+8
Pretty much. You do the round before it is held and give feedback to problem authors. You can also upsolve and give suggestions and feedback to authors even after testing. Basically helping with problems as it's much easier to make good problems when you have opinion from a lot of people. |
+8
Why do you think so? |
+8
I think for Problem C hint 2 should be n/2-1. |
+8
A bit tougher than usual Div2, but the problems were amazing. I felt B > C, especially proving that binary search works in B has taken a lot of time. |
+8
The fact that n is even should signal that maybe you can somehow split numbers into two groups. Secondly, it'd fairly common to sort permutations in opposite directions (ascending/descending) and match them greedily. Also worth noting, it's very easy to get sums of all elements of final array to be equal to (1+n), by matching $$$p_i$$$ with (1+n-$$$p_i$$$). This was my thought process during the contest, it's really just 3 standards ideas combined together. If you write all these out at some point you'll notice that you can ensure (n+2) is reachable in n/2 points so ot suffices to make the others no greater than n+1, which like we said has an easy construction. |
+8
great explanation sir : ) |
+8
Hey! Check out my video solutions for the contest. I've covered Problem A-D here: https://youtu.be/owawrSp2ywU |