Hi!
On Oct/10/2020 17:50 (Moscow time) we will host Codeforces Global Round 11.
This is the fifth round of the 2020 series of Codeforces Global Rounds. The rounds are open and rated for everybody.
The prizes for this round are as follows:
- 30 best participants get a t-shirt.
- 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive.
The prizes for the 6-round series in 2020:
- In each round top-100 participants get points according to the table.
- The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest.
- The best 20 participants over all series get sweatshirts and place certificates.
Thanks to XTX, which in 2020 supported the global rounds initiative!
Problems for this round are set by me. Thanks a lot to the coordinator antontrygubO_o, to the testers dacin21, Giada, H4ckOm, DimmyT, Retired_cherry, oolimry, nkamzabek, Prakash11, Tlatoani, coderz189, nvmdava, stack_overflows, dorijanlendvaj, and to MikeMirzayanov for the Codeforces and Polygon platforms.
The round will have 8 problems and will last 180 minutes.
The (unusual) scoring distribution is: 500-750-1000-1000-1500-2250-2250-4500.
I hope you will have fun solving the problems!
UPD: The round is postponed by 15 minutes because just before the round there will be a 10-minutes-long unrated testing round. Considering the recent Codeforces downtime, this is a measure to make sure that there will not be technical issues during the real round.
UPD2: There were no technical issues during the testing round, hence the real round will happen. Good luck and see you in the scoreboard!
UPD3: I hope you liked the problems, here is the editorial.
UPD4: Congratulations to the winners!
UPD5: And congratulation to Petr who upsolved H before the editorial was posted! You made me happy!
"The low scores for problems B-C-D-E-F-G should not suggest that they are easier than usual."
but i hope 1000 pointer C,D is not as hard as recent Div2 675 C and if they are, then honestly they deserve more points.
edit: I want atleast 500 downvotes now.
In case of tourist and Petr!!!
as a tester, I want contribution
This is the first round, I ever tested !
Good Luck !!
as a participant I also want contribution.
You should want rating rather
no i don't want rating.
We will give you a contribution after our solutions will not fail in the system test.
how did you become a tester? can you tell me? if there is a link that refers to becoming a tester of the round I would like to know thanks
This
Solving F+G+H, exactly
[del]
Oh please, then make score of every problems twice. What if some contestant gets C/D but not B and gets bad position due to closer score distribution. And in combined rounds, its common to get tougher B(at least for me)
....so basically if LGMs can solve H they will participate, else skip the round?
... especially if they are not running for top positions in the 6-round series
I hope not! I hope they will participate to have fun, not (only) for the rating.
Note the duration -- 3 hours!
As a tester, I am very lucky that no one will see how bad I was in this round.
dario2994 "500-750-1000-1000-1500-2250-2250-4500", Can we expect C and D to be equal in difficulty and same with F and G( though I don't care about F and G, since I have never solved that many problems in a contest )
Yes.
maybe you need to care about F and G to solve them
Yes, I am focusing on improving my advanced data structures and upsolving 2000+ scored problems. Lets hope soon I would be able to solve them and increase my speed for solving Div2D as my next goal is become master.
can't believe I never thought of this. I'll just make sure I care about H this weekend. see y'all in GM!
update: 2397, but if I solved H, then I think I would have made it
As a tester I want to say that the problems are really interesting. Wishing All of you big positive deltas!!!!
grow up bro
F, on Sunday my rating will go down
Tshirt = H
Adhoc shit incoming
I hope pretests are not weak, otherwise every successful/unsuccessful hack will be worth a lot of rating points.
()
The low scores for problems B-C-D-E-F-G should not suggest that they are easier than usual.
If it doesn't mean B-C-D-E-F-G will be easier, then why the score distribution is like this? Someone could solve A, C, D, and most probably would be behind a guy who only solved A, B, C. Here B & D are playing the deciding factor. How even this is fair if B & D has a normal round's difficulty? I am sorry, but I couldn't get the explanation for the unusual distribution.
you will be downvoted for raising voice towards this stupid score distribution like me
Are you ok Codeforces..?
Codeforces-Chan seems to be ok now ;))
Oh my god, what happened?
there is no logic in making the difference between some problem's score and some other harder problem's score too little just to make F+G=H
oops,after the contest end about 7 hrs there is a big competition called CSP-S1 which is important to Chinese OIers,so many Chinese student(include me) may not take part in it.
upd :
cf contest : 22:35GMT+8 ~ 01:35GMT+8
CSP-S1 : 09:30GMT+8 ~ 11:30GMT+8
nobody cares about Chinese competitions, why are you always complaining about CF contest start time
I am not complaining,but I'm quite sad because I love global rounds' nice problems
nobody cares about you, why are you always complaining about other people
Small but major correction.
should be
Your Atcoder round was great! Waiting for interesting problems here as well.
Maybe F+G=H makes sense for the top but this distribution will make the round worse for the remaining 99% of participants. What about loosening the condition and making it e.g. 3000-3000-4500 for three last problems, along with some adjustments for earlier problems. Also, isn't the score of 250 possible too? And please remember about adjusting points drop/drain for a longer round.
I will go live just after the round and explain my solutions to whatever problems I manage to solve https://www.twitch.tv/errichto
i don't understand how this will make the round worse for remaining 99% participants.
i doesn't seems like they care about H anyway.
They indeed don't care about H so the scoring becomes 500-750-1000-1000-1500-2250-2250. This flat scoring discourages solving problems out of order. And you will get a similar number of points for C and G because of time penalty so better not fail C!
Notice that the average step in 500-1000-1500-2000-2500 round is 500 points (or around x1.5 ratio) while in this round the step will be 291.66 (or ratio $$$(2250/500)^{1/6} = 1.28$$$). More problems and yet smaller difficulty range, hurray.
okay that's make sense
seems like even the top 1% of players also didn't care about H.
Since I see many comments concerned about the score distribution and how it might ruin the contest for many contestants, let me explain. First, three remarks:
Now, let us discuss about what I think is concerning for many people (and I guess is the meaning of "will make the round worse for the remaining 99% of participants"): There is a relatively small difference of scores between B and C,D. Why might this be an issue? Because someone who solves B fast might get a higher score than someone who solves C slow. Because hacks and failing system tests play a bigger role if scores are low.
I claim that none of these issues is real.
I hope I have taken into account at least some of the concerns. In any case, I will not say anything else about the scoring distribution (because I have already spoiled too much about the contest). After the contest, I might say a bit more about the choice of this scoring distribution.
I hope you will like the contest :)
I won't try to convince you about changing the scoring for this round but let me argue further and maybe this will affect some future rounds.
I like strong pretests in C but one can still struggle with WA and decide to skip it. Or just dislike the problem and skip it to solve something more interesting. And there are issues other than getting similar score for C and G. The further we are from geometric scoring, the more we care about the speed of solving easy problems. If scores are 500-1000-2000-4000-8000 and you solve all problems in order ABCDE, then 1 minute spent on A affects your final score a bit less than twice as much as 1 minute spent on E. If scores are 500-1000-1500-2000-2500, the ratio increases from around $$$1.9$$$ to $$$(1+2+3+4+5)/5=3$$$. If scores are 500-750-1000-1000-1500-2250-2250 then it's $$$4.11$$$. If we indeed manage to solve all these problems in time, it's like an Atcoder round but you multiply the time of solving A by 4 (and similar multipliers for other easy problems). This is how ties are decided between people with the same set of problems.
Scores in range [500, 2500] made some sense when we had 5-6 problems per round. If we get 8-9 problems on regular basis, CF should use much wider range of scores. In particular, 4500 points is too little for every hard problems.
And then you realise problem H is another Cube Lattice (1375I)
With the permission of the site administrator, I think we can actually create high-scoring problems by creating the same H1 and H2 problems, avoiding systems that limit the maximum score.
I'm guessing there will be a lot of competition for rank in this competition. Many div 2 people will do A,B,C and many will get similar points for this and same ranking. Getting good rating change is going to be tough for this round. Solving D problem will be the deciding factor for div 2, I guess.
Getting good rating change is going to be tough for this round.
How sarcastic, points are given according to your ranking between the people you compete with. Actually, I don't understand your point of how getting good rating change is tougher than other rounds...
Ok. I will try to solve H first.
Not the correct place to ask but are Educational Round over ? I think every month there were two Edu Rounds.
I highly doubt that edu rounds are over. Just be patient.
Glad to see that they have not stopped
nice contest
Sure, sir.
I had to try haha
To all the people asking how to become a tester, finally your day has come! Together we are all testers in testing round 17.
How so Orz monogon .rz.rz.rz.rz.rz
finally your day has come!
Will Mike make a thread on home page with all our names!LOL!!
I was just about to say "in before the comments section becomes Monogon's twitch chat" but looks like I'm too late now
Hi, dear SecondThread, could you please provide your unbiased opinion regarding the scoring distribution of this round? The smaller differences among A, B, C and D might not be much of a problem to Div1 Contestants, but to all other participants, especially the lower-ranked ones, it could definitely cost us. Just my opinion, tbh.
Ask him in his Algorithms Thread videos.
As a tester of testing round 17, Give me contribution.
So the real contest starts after 10 mins after the 10 mins Testing Round. What if there is some issue and it can't be fixed within 10 mins?
At least they will have an idea and postpone the round.
Hello!Hope that contest will be great and wish you high ratings
Why just not to make testing round earlier instead of "deviating the main round"?
Ikr. That is like why ICPC and IOI 2021 will be in the same week. From the 365 days, they cannot sort this out lol.
Obviously in order to have more participants in the testing round
Hope strong pretests.Come Up~
Hope to change my color in this round . (Else would leave CP forever)
Imagine becoming an admin after this round.
I'm kinda scared. In your last AGC I couldn't even solve a single problem. Hope I can solve at least something this time
Not really :'(
its so relatable
Haha made my day LOL !
made mine day too keep it up with memes :D <3
Me in the future, but as the dad
actually it is a red coder solving only H
probably me at the end of the contest D;
back to back rounds(global and educational) in 24 hours with no time to upsolve!! its going to be a fun weekend and a long week!
What the hell?
How to solve B of the testing round ?
52B - Right Triangles same problem.
Code: [submission:95090566]
Explanation: Compute the number of '*' in each row and column. Say that in number_of_star_in_row[i] = r and number_of_star_in_col[j] = c. The number of right triangles with base grid[i][j] is (r-1)(c-1).
I think the testing round was very slow :(
I think that too! I don't have a good feeling about the round queue.
fortunately there wasn't much of a queue anyway. XD
Was it intentional that the statements of the testing round were not available in m-instances?
I wonder how many T-shirt did tourist get from all the contests
He must be using this much of t-shirts to mop his floor I guess.
DELETED
Div 1.5
Code Forces Global Round 11? More like Code Forces Global Div 1 Round 1. ;-;
Why you guys need to make tough B? Now, I have idea for me but I have only 10 minutes left
Most Deadly Global Round I have appeared in so far .
Whats with the statement of C? It is so complicated for no reason.
Wrong answer on pretest 2 in B? Try this :
1
11 2
WWLWLLLWWLW
ans : 14
How to solve B?
Not tried but have a solid hint :- Try converting consecutive lengths of L as per minimum contiguous L first then next minimum series of Ls and so on until k ends.
This is what i came up with during the contests , it did pass the pretest , hope it passes all the test cases.O:)
yup did the same, counted the gaps or consecutive Ls and sorted them. the last pretest was really good, it gave this idea otherwise I was just growing the existing W substring in length.
Observation : It is always optimal to fill contiguous loss substrings between two wins. Additionally, it is always optimal to completely fill the contiguous loss substring , thats why you sort in increasing size of contiguous loss substrings (excluding prefix and suffix). If you completely fill a loss contiguous substring, answer is incremented by (size of substring) * 2 + 1 . If you partially fill the substring answer is incremented by (size of substring) * 2. ( Note +1 in first case. This makes it optimal to completely fill substrings. To maximize that sort substrings in increasing size. )
If after filling all the substrings, you have some operations left , use them on the prefix or suffix.
Corner Case : When k=0 or number of wins = 0.
Problem C? Thought 2 hours on it yet clueless after one point?
See if you can Come up with O(n ^ 2) dp solution, then make the use of the fact that distance b/w 2 points cannot be greater than 2 * r. So The O(n ^ 2) dp solution can be optimized to O(n * r).
I have come up with O(n^2) solution similar to LIS dp. but TLED on TC5 . i optimised little bit then wrong answer. Actually I am not able to know that within my particular manhattan radius i such that
. and what is the place within current radius where number of celebrity already meet is maximum. I hope you got where I got stuck.
PS: Passed
Got it I realised that points in range i+2*r are important only but not that after that too answer was there, just one step was remaining ! NIce problem thanks anyways.
The idea of using graphics in C was amazing , didn't get the question though !
lol
going live now, talking about ABCDE and my maybe-wrong solution for H https://www.twitch.tv/errichto
How to solve C guys?
DP
how to optiize DP i was able to think of n^2 solution
think with time, then you would be able to optimise it in O(2 * n * r)
ops
I think you replied incorrectly as I asked about C.
sorry that was unintentional
Thats it I am done with global rounds.
So one did solve H after all :(
I believe the TL of G is strict. My first submission is indeed $$$O(N^3)$$$ time solution, but it got TL. My local testing suggested that only iterating the graph represented by
vector<vector<Edge>>
takes much time. Yes, I knew it's time-consuming and I should have noticed that before implementing it. Still, I wish the constraints was $$$n \leq 100$$$ or something.Is there any reason to set this TL, or you didn't noticed solutions like this? Anyway, I like the idea of the problem, so thank you for that.
With $$$n\le 100$$$ there would have been $$$O(n^4)$$$ solutions getting accepted and solutions using fancy min-cost flow implementation (but with bad complexity) getting accepted, and I did not want that. On the other hand, I understand that the strict time-limit of problem G made it slightly harder to get accepted even for $$$O(n^3)$$$ solutions.
is there any dp solution for B
The low scores for problems B-C-D-E-F-G should not suggest that they are easier than usual.
Yes, and they seemed to be even harder than usual.
So much for question H. Zero Solves :)
I've tried to solve problem C making a graph in which a node is a celebrity, and there's an edge between $$$v_1$$$ and $$$v_2$$$ if $$$v_1$$$ appears before $$$v_2$$$ and it's impossible to take a photo to $$$v_1$$$ and $$$v_2$$$. And now you have to get a maximal independent set of the graph. As far as $$$t_i < t_{i+1}$$$ and the grid is not very big, any node won't have too much edges, anyone think about it? Due to lack of time because I got that idea in the end of the contest I couldn't try to implement it, but I'd like to know if it works or not
how to optimize DP solution of C ... i got n^2 solution??????? thanks for help
Hint: you can reach any position on the map with at most 1000 time.
i got it ....
;)
How to solve D. I was able to come up with a solution that requires at most $$$2 * n$$$ operations. But how to do it in at most $$$n$$$ operations.
In every step try to put them into (1, 2, ..., cur, ...) or (..., cur, ..., 2, 1). Just zone 1 of them into the streak each operation. Save the last one for rotation.
Step 1 : get 1 as a prefix.
Step 2 : get 2,1 as a suffix.
Step 3 : get 1,2,3 as a prefix.
So on.
Its probably something like putting $$$(1, 2, ... , x...)$$$ and $$$(...x, ... , 2, 1)$$$ alternatingly. Like this. for this sequence $$$2, 3, 6, 1, 4, 5, 7$$$
Moves are like this
$$$1, 4, 5, 7, 2, 3, 6$$$
$$$2, 3, 6, 4, 5, 7, 1$$$
$$$1, 2, 3, 6, 4, 5, 7$$$
$$$4, 5, 7, 6, 1, 2, 3$$$
$$$1, 2, 3, 4, 5, 7, 6$$$
$$$6, 7, 1, 2, 3, 4, 5$$$
$$$1, 2, 3, 4, 5, 6, 7$$$
I don't know the proof nor I implemented it(it was only 10 min left). But, probably this is correct.
How to solve D, I thought of something like grouping every ele and ele-1 together and doing this over and over again.
So much for "spicing up the strategies". Maybe it would've worked for a different contest, but it doesn't make for a very fun experience with speedforces and hard problems with low point values. As for top contestants, the other problems were hard enough for no one to solve H even with a 3 hour contest time.
I splits the array into two parts. One is positive part and another negative part.. If the sum of positive part is bigger than I printed that first and then negative part. Same for the negative part, and if both are same then answer will be NO. But I noticed one thing, if I print 0 with positive part, it gives me wrong answer. If I print 0 with the negative part it passed the testcases. If multiple answers are possible, then 0 can be in any side, it doesn’t effect, right?
And one more thing, If I don’t sort my split parts it also gives wrong answer.. But why sorting is needed? I just need to check if the sum is not 0. Sorting shouldn’t be a matter, right?
Please tell if I am wrong.
Mycode: https://mirror.codeforces.com/contest/1427/submission/95120716
Consider the case:
0, 1, -1, 2, -2
. Without sorting and keeping the zeroes with negative numbers you will get:0, -1, -2, 1, 2
or something similar which is wrong.But it is wrong already, because the sum of total array is 0, which can't be printed. Right?
then consider 0 1 -1 3 -2
This round is sooo hard. Here are my solutions to A-E:
If the sum of all values of all $$$a_i$$$ is 0, the answer is NO.
Otherwise, the answer is YES. If the sum of all values of $$$a_i$$$ is positive, put all the positive values before the nonpositive ones. If the sum of all values of $$$a_i$$$ is negative, put all the negative values before the nonnegative ones.
Let's calculate our score in a different way. The score is equal to $$$2 \cdot \mathrm{wins} - (\mathrm{number\ of\ contiguous\ blocks\ of\ wins})$$$.
Obviously, we never want to change wins to losses. Therefore, we know the number of wins we would have at the end, which is $$$\mathrm{min}(\mathrm{initial\ wins} + k, n)$$$. Now we just have to minimize the number of contiguous blocks of wins.
Let's put all gaps between adjacent blocks of wins into an array and sort it. Then fill gaps with wins, starting from the smallest gap.
The case where there are no wins initially needs to be separately handled.
Do a DP. $$$f_i$$$ represents the maximum number of celebrities from 1 to $$$i$$$ that we can visit, if we are required to visit celebrity $$$i$$$.
An $$$O(n^2)$$$ solution is now obvious. To reduce this to $$$O(nr)$$$ we note that if the time difference between two celebrities is $$$2r - 2$$$ or greater, we can always go travel between the two celebrities (because $$$2r - 2$$$ is the maximum Manhattan distance between any two points).
Therefore, when doing the transition for the DP we only need to manually check the previous $$$2r - 1$$$ celebrities. All the celebrities before that can come to our current celebrity, and we do not need to check each. Just maintain a maximum variable that holds the maximum $$$f_i$$$ of these celebrities.
After the first $$$i-1$$$ operations, we want the values 1 through $$$i$$$ to occupy a contiguous interval in the array, and we want these values to appear either in sorted order or in reverse sorted order.
Before any operations are performed, the condition is obviously satisfied. With the $$$i$$$-th operation, we want to join the value $$$i+1$$$ to the contiguous interval we have. There are several cases that we need to handle, depending on whether $$$i+1$$$ appears to the left or to the right of the interval, and whether the interval is in sorted or in reverse-sorted order. (The details are not too hard to figure out.)
We have performed $$$n-1$$$ operations now. We might need one final operation to reverse the entire array, if the values 1 through $$$n$$$ are currently in reverse-sorted order.
Disclaimer: I have no idea why this works, or even whether it will continue to work if the constraints are increased. Some of the claims made below might not hold for larger values. The only thing I know is that this solution can pass all test cases within constraints.
See the procedure used in the first sample? Turns out, this procedure can be generalized. Subject to certain conditions, the XOR of the initial value and the final value is equal to 2. The requirements are: - In the binary representation of the initial value (with no leading 0's), there cannot be two 0's in a row. - The bottom 2 bits of the initial value must be 1.
Once we have a 2, we can easily eliminate all bits in any number (except the bottom bit), and thus create a 1. Now we focus on how to generate a number that satisfies the requirements.
Turns out, for any $$$x$$$ within the constraints, there always exists a reasonably small number $$$k$$$ such that $$$kx$$$ satisfies the requirement. We can find $$$k$$$ by brute force, and multiply $$$x$$$ by $$$k$$$ (this can be done by finding $$$2^{p}x$$$ for each $$$p$$$ and sum them together based on $$$k$$$'s binary representation).
The low scores for problems B-C-D-E-F-G should not suggest that they are easier than usual. Now i know this is true. I only solved three problems in total. Problem B thought about a wrong algorithm at the beginning and wasted a lot of time. B is obviously harder than usual div2B, and C is also harder than usual div2C. D may be the same as usual div2D.upd: 10 minutes after the start of the competition, I still can't see the complete content of the question. In the mathematical formula part, all I see are inexplicable symbols. How is this going?
How to solve H?
To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove cheaters and update the ratings again!
Nice. Now I see I fucked up this round sooner.
Ratings updated! That was quick.
Wrong submissions were a bit too pricey, and constructive tasks as always. Otherwise great contest!
https://mirror.codeforces.com/contest/1427/submission/95098796 Please tell me why was it giving runtime error.
AkshitDh
int a[n]={};
cin>>n;
Here you should read n first then declare array a.
Thanks
Moral : Always check all possible inputs when the number is reasonable. Still passed all pretests even though the solution fails on a large number of inputs.
How to solve E systematically? I really played with numbers for 1.5 hours and couldn't find any solution :(.
Reach a number $$$X$$$ that can be made such that $$$gcd(X, N) = 1$$$. One possible number would be: $$$N \oplus (N . 2^B)$$$ where B is the highest power of $$$2$$$ less than $$$N$$$.
Proof:
$$$X$$$ = $$$N \oplus (N . 2^B) = N + (N . 2^B) - 2 . (2^B) = K.N - 2^{B+1}$$$, which has no common factor with $$$N$$$. ($$$gcd(K.N - 2^{B+1}, N) = 1$$$, as $$$N$$$ is odd)
After that we need to find a solution $$$(a,b)$$$ to $$$a.X = b.N + 1$$$ where $$$b*N$$$ is even.
This can bruted by iterating on $$$a$$$. ($$$a$$$ will be upto $$$2N$$$)
Now we just print $$$b.N$$$ xor $$$a.X$$$
I think weak systests for C?
95127155
500 2 950 500 500 3000 1 1
Output should be 1, mine is 0, so WA. Please correct me if I'm wrong.
Uphacked.
Hopefully MikeMirzayanov won't take away my 111 point rating increase=))
Probably not, the hack after the game is not counted.
Guys how are the "best participants" selected?
Petr after getting -11 on H during contest
Just after contest, my ratio changes +179. But after few hours : +180, even I'm still rank 80. Why?
probably one of the best rounds i've ever participated in. Good problem statements, clear explanations, beautifully difficult tasks, and no technical issues! Hope more rounds could be like this
The topic is a little difficult, but it inspires me to continue to study hard. The team is wonderful
For ABC and D, the points rating is double the points give to it.
Excellent round btw
Well-balanced difficulty unlike most atcoder rounds
Algorithmic, not mathy. It is individual but I like it
Good balance of idea and implementation
Visible effort put into editorial
I felt thrill throughout the whole contest
When is the list of people who will be getting random t-shirt coming out?
Congratulations to tshirts winners!
What would happen if I didn't fill in my address until today? :(
I hate that problems
Perhaps you want to know current results of globals. See https://clist.by/standings/codeforces-global-rounds-2020-18730990/.