Блог пользователя shishyando

Автор shishyando, 5 лет назад, По-английски

Dear Codeforces Community,

Kirill22 and I are glad to invite you to Codeforces Round 781 (Div. 2), which will take place on Apr/08/2022 17:35 (Moscow time). This round will be rated for the participants with rating lower than 2100

These are some great people that we would like to thank:

You will have 2 hours to solve 5 problems.

One of these problems is interactive, please see the guide of interactive problems if you are not familiar with it.

The scoring distribution: 500 — 750 — 1250 — 1500 — 2250

P.S. I have been waiting for a long time to hold another contest and now this time has come. I really hope that you will like the problems, good luck!

UPD: Editorial

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

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

Me seeing a 5-problem round and this score distribution: Regular C->D->B->A tactic goes brrrrrr

Time to start solving from the beginning again. The era of valueless A's has gone!

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

As the richest tester, give me contribution.

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

Finally a div2 round. Wish everyone good luck!

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

If you downvote this comment, you will lose rating) Good score distribution, wish everyone good luck

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

Only 5 problems... Is it mean that E will be harder than usually ?

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

Excited about the interactive problem!

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

It is seems to be a speedround as the friendly scoring distribution qwq

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

As a tester can say, that round made by the legends!!!!

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

Only 5 questions in the round! Hope it's not a speedforces round.

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

Ivanovo is everywhere

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

I likes codeforces and contest.Good luck to all

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

This time no specialist as a tester!

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

Good luck!

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

As a friend of tester Codula ,give me contribution

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

Five problem contest (◎﹏◎) Hoping it to be a hard contest. :)

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

From Ivanovo with love!

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

As a tester i highly recommend you to read all tasks!

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

which one is the interactive problem C or D ?

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

Good luck everyone! I wish you an awesome contest. and thanks for everyone who worked hard so we can have fun after 2 hours!!

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

I think D is a good problem.

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

The statement of problem B had some issues ..anybody else felt the same??

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

Is there a reason not to have $$$a, b \leq 3 \cdot 10^9$$$ (or lower have a smaller limit on $$$x$$$ if 32 bit integer overflow was your issue) in D?

At least for my soln, not being able to query $$$2^{31}$$$ requires me to handle the bit corresponding to $$$2^{29}$$$ being set as an edge case due to this :/

Nice problem regardless though.

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

How to solve E?

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

logoforces minforces

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

keep getting WA 1.5h on C, I misunderstood that all sons of any specific same parent vertex v can infect like 1->2, 2->4, 4->8.

I got an AC in 6 minutes since I realize that I was wrong before.

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

DELETED. (Sorry I misunderstood something.)

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

Anyone please help me!.. How to solve C? I tried to find of the number of parent nodes with at least one child , that is the minimum number of seconds we need to infect at least one. After that i sorted the sizes of them in order of the number of children each parents have in descending order. Then found out how many extra child's i need to infect in remmaining , If the number of extra child's i need to infect in ONE parent is odd , then i can also infect the root with it in [((extra+1)/2) + infected] seconds in total. But if it is even , then i need to infect the ROOT node [1] separetly , thus needing [((extra)/2]+1) + infected] seconds in total. I take the max value over all of these.

I am failing on tc 6.

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

    I kind of lost you halfway through your explanation (though I will note that you always need to infect root manually) but I can explain my idea.

    First just count how many separate disjoint sets of nodes there exist that can infect each other. Easily it is shown that all children of a node n belong in the same disjoint set. We can then simply represent these sets by numbers — so our final result is just a vector of numbers where each number is the size of this set.

    Now clearly it is optimal to first infect a node in the largest of such set. Also you must infect at least one node in every set. So sort the list in non-increasing order and remove the nodes you infect in each set. (So if you have 7 disjoint sets, you must remove 7 nodes from the first set in the list, 6 from the second... and so on until you remove 1 from the last).

    Now, you may or may not need to spend some additional seconds (call them t additional seconds) to infect some more nodes.

    We will binary search on additional seconds t.

    Suppose you need to spend t seconds. At least all sets you can subtract t from, and you may also pick t arbitrary nodes to infect.

    So, from our sets, remove t from each node, and then see if there are less than t nodes left. If so, then we can accomplish our goal with t nodes.

    Our final answer is size of sets + t.

    153054530 for clarity.

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

Implementation of Problem C is on next level.

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

cool round

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

$$$D$$$ can be solved in $$$23$$$ queries by letting $$$x=4\times 5\times 9\times 7\times 11\times 13\times 17\times 19\times 23=1338557220 \gt 10^9$$$, asking $$$(i,x+i)_{1\leq i\leq 23}$$$ and use Chinese Remainder Theorem to combine the answer.

So it's basically not falling into the paradigm of another boring interactive problem that uses binary search :)

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

Can someone tell me why https://codeforces.me/contest/1665/submission/153033033 is TLE for Problem B? The solution is O(n)...

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

Somebody leaked my solution of B from room on YouTube . I don't know what to do now . Please help !!!

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

When i submit B it passes all pretest but now, It shows tle in 13 pretest why?

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

I am getting a WA on TC 20 in problem C , can someone tell what's wrong with my code

Solution link

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

so thx for anti-unordered_things test in B :)

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

Thanks for the amazing contest, really enjoyed it. How long does it need for the rating to change?

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

Is it possible to solve E with mo's and trie?

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

Can someone tell how the answer would be 4 for this test case for Question C

9 1 7 7 7 1 1 1 7

Thank you

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

Here's a screencast of me doing todays codeforces round:))

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

When will rating be updated?

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

Rating has not been updated yet!!!

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

Problem D is very similar to a problem from Spain's Olympiad in Informatics 2022, which was held just last weekend.

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

Thanks for the round, every task is interesting.

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

Hi,
In the second problem, when I use a hash map to get the frequency of each number, I get Time limit exceeded on test 13. But when I use a map to do the same, It's accepted. Could anyone tell me why it's time limit when using a hash map?

PS: this solution using hash map and this solution using a map.

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

Solved B problem using unordered_map got TLE, Upsolved B using map with the same code and got accepted.

Is this a joke or what??!! :-)