Educational Codeforces Round 124 [Rated for Div. 2]
source link: http://codeforces.com/blog/entry/100734
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Educational Codeforces Round 124 [Rated for Div. 2]
Hello Codeforces!
On Thursday, March 10, 2022 at 14:35UTC Educational Codeforces Round 124 (Rated for Div. 2) will start.
Series of Educational Rounds continue being held as Harbour.Space University initiative! You can read the details about the cooperation between Harbour.Space University and Codeforces in the blog post.
This round will be rated for the participants with rating lower than 2100. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally.
You will be given 6 or 7 problems and 2 hours to solve them.
The problems were invented and prepared by Adilbek adedalic Dalabaev, Vladimir vovuh Petrov, Ivan BledDest Androsov, Maksim Neon Mescheryakov and me. Also huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.
Good luck to all the participants!
41 hour(s) ago, # |
Me to chance pupil coder again,,,,,
-
Hope your rating can get over 1200 after this contest! By the way, your profile photo looks interesting, so I used it as my profile photo. :)
-
Thanks you for your wising,,,, By the way i need perform like your profile graph and reach 1600+ rating,,, how can i do..../?
-
Maybe you can try to solve some problems that have a higher rating than you currently have in the ProblemSet?For example, try to solve problems with a rating about 1400?
-
-
40 hours ago, # |
Good luck everyone !
39 hours ago, # |
Good luck everyone!!!
35 hours ago, # |
Good luck everyone!!
33 hours ago, # |
Sadly, overlaps with Reply Challenge.
Probably, if there's lot of participants wishing take part in both, could be moved one hour earlier?
31 hour(s) ago, # |
Hope everyone to get higher rating in this round!
30 hours ago, # |
good luck guys
29 hours ago, # |
Good luck everyone!
28 hours ago, # |
I like Educational round.Thanks to the organizers.
27 hours ago, # |
contest is a kind of festival to me!
22 hours ago, # |
Any Interactive problem?
19 hours ago, # |
Could some one create a group to collect all educational contests like Div. 3 ?
-
Use this website here you can filter contest based on contest types and many more things you can do https://clashofcodes.herokuapp.com/codeforces
18 hours ago, # |
Considering my downward trend of performance in the recent Educationals, I can't help but
18 hours ago, # |
I have a question how do we know the difference between final standings after system tests and when hacking phase is finished? from what I have seen they don't write anything to distinguish that
17 hours ago, # |
|| codeforces ||.
16 hours ago, # |
Why such a huge difference between problem B and C, kinda unfair for pupil / specialists
-
Actually it was not so unfair since you required just one observation for C.
HintReason-
I am sorry but ... shouldn't connecting any 2 pairs do it? I mean having 2 connections between 2 distinct pairs, this way if one fails the any other is reachable.
I spent about 30 minutes asking myself why the hell does the first test case need to connect 4 pairs.
-
No it is not necessary.
Reason
-
-
I think i know my mistake in C but not enough time damn I wasted so much time thinking about stupid possibilities that doesn't help in anything
we could do it in three wires right ? like this
1 0 0 2 0 3
1 0 0 3 0 2
i tried only 2 wires or 4 but not 3.
-
you just need 2 wires
link 1 1 and 3 2
make it a loop
16 hours ago, # |
Experts and CMs after solving A-D:
Btw Im writing this comment 23 minutes before the end of the contest. I have no idea what to do with all this time on my hand:))
16 hours ago, # |
Isn't problem c only about first and last index of both arrays and finding optimum values in their counterpart arrays?
16 hours ago, # |
D can be solve by dfs.. right ?
and C statement was confusing for me :(
-
My DFS failed, needed BFS. What do you do if your DFS has back edges?
-
I used BFS (from neighboring points not in the given set) and still got TLE. Is this not the idea? Or is there a way to speed up my BFS? 149168850
-
Phew, just looked at your code, it looks ok in principle, your times seem to be ~1.5-2x slower than mine. Guess you need constant optimisation here maybe? In your first loop, when looking for borders, it seems that you can push solitary points 4x into the queue. You can put a
continue;
there in your ifs. Also you can mark them as used then already.Yes, constant optimisation did the trick: 149174036
-
-
What was the 2nd testcase in C?? I tried all the cases can someone tell what I was missing?149157891
16 hours ago, # |
Is DP the correct approach for D? I tried to check the answers of my neighbours and pick the best for me but got TLE on test case 9 :(
-
You can use a DP-like idea. The intuition for me was, for a point, the closest point to [x, y] must either have the same x value (so it's on the same vertical line), or it must be on a path through [x — 1, y] or [x + 1, y].
15 hours ago, # |
How to solve D? I used dfs to transmit the nearest point but got wrong answer! :-(
-
I solved using multi-source BFS from all untaken points neighbouring taken points
-
I tried something similar, but because i am not pro like it took some time for me to code it well. basically what i did is pushed all the points that has an direct answer into queue. (more like pushed the outer layer of points in queue first). then i translated outer layer's answers to inner layers. but i got Wrong answer on Test 9. can you help if you find anything sussy here?
Edit: no worries got accepted. it. was a minor issue :(.
-
That's unlucky. I was trying to debug for you but couldn't understand the candidates things. In principle your idea is correct, and equivalent to what I described as multi-source BFS, except starting with the outermost points rather than untaken points. Should achieve the same result.
-
-
15 hours ago, # |
What was the technique for B? I wasted so much time on A due to a stupid typo.
-
Suppose you'll do the operation on xx and mxmx which are present in the array where m≥1m≥1. After the operation, xx and mxmx will be replaced by mx−xmx−x, we want the change of the sum to be greater or equal to the previous sum, which implies 2(mx−x)≥x+mx2(mx−x)≥x+mx ⟹m≥3⟹m≥3
So, you build the array like this: [1,3,9,27,...][1,3,9,27,...] until the array size is nn or the value gets higher than 109109. For the later case the output is NONO.
15 hours ago, # |
In C my idea was that computers at end must be connected to some other computer, so we must find a way to minimize this. But for whole 1 hour I was not able to implement due to edge cases of computer at ends being connected to each other. I knew edge cases(like first computer of array A can be connected to first computer of B or last computer of B or both first and last computer of B etc.) but was not able to implement and deal with those.
Any tips on how to improve this ability? Sometimes I break down a problem in different edge cases and get overwhelmed by that.
15 hours ago, # |
it really was an intersting contest i have solved C with topology :" which i have studied in CS
Still WA on test 2 :( 149166751
-
I calculated all 7 cases.
// Case 1: a1 to b1 and an to bn; ans = min(ans, a1_b1 + an_bn); // Case 2: a1 to b1, min bn, min an ans = min(ans, a1_b1 + a_n + b_n); // Case 3: a1min + b1min + bnmin + anmin ans = min(ans, a_1 + a_n + b_1 + b_n); // Case 4: a1min + b1an + bnmin ans = min(ans, a_1 + b1_an + b_n); // Case 5: a1 to min, b_1 to min, an bn ans = min(ans, a_1 + b_1 + an_bn); // Case 6: a1 to bn, an to b1 ans = min(ans, a1_bn + b_1 + a_n); // Case 7: a1 to bn and b1 to an ans = min(ans, a1_bn + b1_an);
-
[Updated] Failing testcase: Ticket 1699
15 hours ago, # |
How to solve D ? I got TLE on test 9.
-
I think it's BFS + Dijkstra. If a point in the input is next to any empty point, then the answer is either 1 or 2. The other points must border at least some point in the input. From there you just BFS + Dijkstra to get the point with the least distance to empty point and populate the neighboors
15 hours ago, # |
Can anybody help me figure out what‘s wrong with my code149129168 in problem B? it runs well on my computer but kept failing the preset when I submit, I was literally driven crazy during the contest (╥_╥)
15 hours ago, # |
I got WA in C because of a typo :)
In problem D, I used a similar idea as This Atcoder Problem. For each point, i binary searched for the shortest distance and used merge-sort tree to check the number of points that has smaller distance than a certain number with that point. I noticed that the distance should be smaller than sqrt(n), so after finding the distance i brute forced through all possible points for the answer.
I think The final complexity is O(nlog^3 + n*sqrt(n)*log)
but got TLE on test 9. This will be my 6th consecutive rating drop.(╥_╥)
15 hours ago, # |
my submission for D giving MLE... If anyone have experienced similar problem, please help me
Is O(Nsqrt(NlgN))O(Nsqrt(NlgN)) intended for problem F? I know that we can do pure Nsqrt(N)Nsqrt(N) if we solve for each block for each monster instead of for each monster for each block, but still, it sounds like a lot of work :(
-
Model solution is O(NlogN)O(NlogN), but we decided to allow slower solutions with good implementation pass (although O(NNlogN−−−−−−−√)O(NNlogN) sounds kinda scary)
-
Not at all mine runs in 1.5 seconds which is kind of okay also it's really easy to write and you can argue that if written with prefix sum the operations would be simple enough that you wouldn't be able to differentiate between O(NlgN)O(NlgN) and O(NsqrtN)O(NsqrtN) "unless you go full Chinese on the constraints/test data ig".
14 hours ago, # |
If you are/were getting a WA/RE verdict on problems from this contest, you can get the smallest possible counter example for your submission on cfstress.com. To do that, click on the relevant problem's link below, add your submission ID, and edit the table to increase/decrease the constraints.
If you are not able to find a counter example even after changing the parameters, reply to this thread, mentioning the contest_id, problem_index and submission_id.
14 hours ago, # |
is cf_predictor gives correct predicted values ? i think that there must much increasing points in rating than i see in standings.
13 hours ago, # |
Screw C. Took more than an hr to solve it, and 40 minutes to finish D but not time to submit it
My approach for D:
Rotate coordinate space by 45 degree by transforming (x,y) with (x+y, x-y). Now, for a point X, observe that all 4 points at distance 1 form a square, then next 8 points at distance 2 form another square and so on. Each square will have 4D points here D is distance from X.
Since N is 2*10^5, D can be at most 350. So for each point, I checked number of input points in squares of length 1, 2...350. As soon as I get a square of length d which has less than 4d points, we need to search in this square.
Then its simply searching all points at distance d and returning any one excluded point.
Complexity: O( N*Sqrt(N)*log(N) ) Solution: 149223014
But solution TLE'd on test case 30. Would appreciate if someone can take a look at my code and suggest scope for optimization.
My ideas for D (not AC on contest) :
Pick a random unvisited point name it pp and mark this point as visited
Do floodfill to another points adjacent from pp and mark them all as visited (adjacent : manhattan distance is equal to 1)
So now from all the floodfilled points we form a connected component from pp. Pick border points from this connected component (a point is called border if there's at least 1 adjacent point which doesn't exist in the input)
From all border points, we can get their respective "source" (i.e. the neighboring point which is not in the input)
Do multisource BFS from all border points and now you can get source for all non-border points by setting it to the source of their nearest border points
My implementation 149198396
I love the idea of the solution! Didn't quite like C (because caseworks), but this problem has a beautiful solution
3 hours ago, # |
chance to get specialist...
85 minutes ago, # |
I want to know how people know this formula for problem B :
(b — a) * 2 >= b + a
14 minutes ago, # |
when are the ratings going to update as it's past 12 hr already?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK