Автор awoo, история, 5 лет назад, По-русски

Привет, Codeforces!

В Mar/10/2022 17:35 (Moscow time) состоится Educational Codeforces Round 124 (Rated for Div. 2).

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Этот раунд будет рейтинговым для участников с рейтингом менее 2100. Соревнование будет проводиться по немного расширенным правилам ICPC. Штраф за каждую неверную посылку до посылки, являющейся полным решением, равен 10 минутам. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 6 или 7 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной придумывали и готовили Адилбек adedalic Далабаев, Владимир vovuh Петров, Иван BledDest Андросов и Максим Neon Мещеряков. Также большое спасибо Михаилу MikeMirzayanov Мирзаянову за системы Polygon и Codeforces.

Удачи в раунде! Успешных решений!

UPD: Разбор опубликован

  • Проголосовать: нравится
  • +196
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

Me to chance pupil coder again,,,,,

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Good luck everyone !

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Very sad that I can't participate

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Good luck everyone!!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Chance to get to pupil....

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

Sadly, overlaps with Reply Challenge.

Probably, if there's lot of participants wishing take part in both, could be moved one hour earlier?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

Hope everyone to get higher rating in this round!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Good luck everyone!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

contest is a kind of festival to me!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -27 Проголосовать: не нравится

Kindly note unusually usual time.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

My first comment. plz I really hope to be the expert

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hope my rating will get over 1900 today.Good luck to everyone as well.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Could some one create a group to collect all educational contests like Div. 3 ?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Considering my downward trend of performance in the recent Educationals, I can't help but

Spoiler
»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится -16 Проголосовать: не нравится

C was tough one

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

DistanceForces

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

$$$|$$$ codeforces $$$|$$$.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why such a huge difference between problem B and C, kinda unfair for pupil / specialists

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

Why such a huge difference between problem B and C, kinda unfair for pupil / specialists

»
5 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится +2 Проголосовать: не нравится

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.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Experts and CMs after solving A-D:

Image

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:))

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

What was the testcase 2 in C ??

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Isn't problem c only about first and last index of both arrays and finding optimum values in their counterpart arrays?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

hints for problem E pls

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

How to solve C and D?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

D can be solve by dfs.. right ?

and C statement was confusing for me :(

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

What was the 2nd testcase in C?? I tried all the cases can someone tell what I was missing?149157891

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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 :(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

How to solve D? I used dfs to transmit the nearest point but got wrong answer! :-(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What was the technique for B? I wasted so much time on A due to a stupid typo.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve C? I tried with all 3 cases, but WA on tc2 149150730

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

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.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

it really was an intersting contest i have solved C with topology :" which i have studied in CS

»
5 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится
My approach for C

Still WA on test 2 :( 149166751

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +4 Проголосовать: не нравится

    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);
    
  • »
    »
    5 лет назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится +1 Проголосовать: не нравится

    [Updated] Failing testcase: Ticket 1699

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

How to solve D ? I got TLE on test 9.

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +1 Проголосовать: не нравится

    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

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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 (╥_╥)

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +9 Проголосовать: не нравится

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.(╥_╥)

upd: My contest submission

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

my submission for D giving MLE... If anyone have experienced similar problem, please help me

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve D?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve D?

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Is $$$O(Nsqrt(NlgN))$$$ intended for problem F? I know that we can do pure $$$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 :(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +34 Проголосовать: не нравится

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.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

is cf_predictor give correct results? why it predicts low increasing values in this contest ? is rating in code forces changed?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

is cf_predictor gives correct predicted values ? i think that there must much increasing points in rating than i see in standings.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Screw C. Took more than an hr to solve it, and 40 minutes to finish D but not time to submit it

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

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.

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

My ideas for D (not AC on contest) :

  1. Pick a random unvisited point name it $$$p$$$ and mark this point as visited

  2. Do floodfill to another points adjacent from $$$p$$$ and mark them all as visited (adjacent : manhattan distance is equal to 1)

  3. So now from all the floodfilled points we form a connected component from $$$p$$$. 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)

  4. From all border points, we can get their respective "source" (i.e. the neighboring point which is not in the input)

  5. 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

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

chance to get specialist...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I want to know how people know this formula for problem B :

(b — a) * 2 >= b + a

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    We need the next sum to be no less than the previous one. If we change a and b to |a — b| then their sum will be equal to |a — b| + |a — b|. We can expand the module and get (a — b) *2. And by condition, we want this sum to be at least a + b. => 2 * (a — b) >= a + b

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

when are the ratings going to update as it's past 12 hr already?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

When will the rating be changed?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

The rating is still not updated......

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by awoo (previous revision, new revision, compare).

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I didn’t get rated yet ?? Why any idea

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hey does anyone know why I didn’t get rated yet is educational round ?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Me here reloading the website every 10 seconds for +2 delta :/

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

In yesterday's competition, my code for question B was judged to be duplicate with others, but my code was submitted earlier, so there is no possibility of plagiarism at all. Plus, I want to score 2100 for this game, so there's no way I'm giving away my code to anyone else. Moreover, the solution shown in my code is a very general solution, and it is very easy to repeat it in a small amount of code. I don't think it's reasonable. Please check it carefully!

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I had a coincidence of my solution(149124483) matching with solution(149099666) of Performanceartist for the problem 1651B . clearly it is a coincidence as he is a candidate master and i a newbie with no prior communication between us. He submitted his solution much before me. please look into it. Your text to link here...

he(performanceartist) has commented for the same problem.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

The worst C problem I have ever solved.

»
3 года назад, скрыть # |
 
Проголосовать: нравится -10 Проголосовать: не нравится

I can't even see if there is any same place between my code 234454715 and 234466169, can officials check again, and it's no reason to copy such a easy problem with risks.