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

Привет, Codeforces!

5 июня в 18:05 MSK состоится Educational Codeforces Round 22.

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

Раунд будет нерейтинговый. Соревнование будет проводиться по немного расширенным правилам ACM ICPC. После окончания раунда будет период времени длительностью в один день, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 6 задач на 2 часа. Мы постарались сделать раунд так, чтобы в нём нашли что-то интересное для себя как начинающие участники, так и опытные программисты.

Задачи вместе со мной готовили Михаил awoo Пикляев и Владимир vovuh Петров. Благодарим за тестирование Максима HellKitsune Финютина и Алексея ashmelev Шмелёва.

Желаем удачи в раунде!

UPD: Разбор задач.

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

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

Hi every one.... is there any way to search problems by their tags? thanks

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

I'm new to codeforces and this is my first educational round! Excited! :P

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

Too few comments! Isn't it weird?

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

Why is E not an interactive problem?

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

Can someone solve me B?I have idea but can't implement.

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

    You can find all unlucky years in log(r)^2, then just sort them and find maximum length between all pairs of neighbours in sorted array. Also check for segments starting in l, and ending in r.

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

Stop killing the cute MO solutions xD.

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

How to solve F ?

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

I should have copied my Persistent IT code instead of trying to re-invent it...

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

Nice problems! What were your solutions for C?

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

    Calculate all the distances from Alice and Bob, and find the node where the distance from Alice is maximum and greater than the one from bob, multiply that distance by 2 to get the number of moves.

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

      why this solution is right ? can you give more details why we should do another dfs where from the position bob stands thanks in advance

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

        The best strategy for Alice is to always go down in the tree. Bob wants to survive for as long as possible so his best strategy is to go to the furthest node from Alice. As explained in the editorial, Bob needs to go up in the tree (by 0 or more nodes) to reach the branch that leads to the furthest node. Sometimes this cannot be achieved since Alice will be there before Bob. That's why you need to check both distances.
        I hope this helps. :)

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

    Notice that Alice will walk down the tree to wherever Bob is, and that the number of steps it will take is just the depth of that path in the tree. That means that Bob should try to get to a node that has the greatest depth.

    If the root node is at level 0, and Bob's node is a level x, the Bob can walk up at most nodes up before choosing to go down the path that has the greatest depth. We can find the depths of the paths using a dfs.

    My Submission: 27589077

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

Any hints on how to solve E?

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

pls make a div1 contest :'(

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

when will we be able to hack???

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

How to solve problem-B?

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

Could one hack it :)

It failed :(

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

can some one tell me the answer for the following test case for problem C 16 12 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 3 11 11 12 12 13 13 14 14 15 15 16

i think the answer is 14. but seems its wrong please help!

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

Почему на мой взлом мне пишут "Неизвестный вердикт"

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

Nice problems, Why the rated rounds are not like this round? :"D

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

Can anyone give me a simplified version of test 8 in problem C?

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

FeelsBadMan

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

Had any One Solve problem C using dp ?!

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

I am getting WA on problem C for a case which is not valid and the case is also showing valid for hack input. But in the problem it is stated that "Bob starts at vertex x (x ≠ 1)." But in this case x = 1. Please check it.

Here is my code: 27597100

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

Is there any way to get the hacking tests so that I can verify my solutions?

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

Any idea how to solve D?

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

I got a wrong evaluation from Codeforces on Problem B. After the contest, When i checked the test case where i got Wrong answer. The output computed by Codeforces was wrong. I was getting a different output (the correct one) on all the other IDEs. Kindly look into this. 27593531 [Test #10]

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

can some one help me with this? There is an array of integers,we need to answer queries in this form. given L,R and A,B need to count number of numbers in range [A,B] in the subarray [L,R].each query should be solved in logn time.what is the best datastructure to use here?

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

Some of the successful hacks for problem C had incorrect tests in it (there was a bug in validator).

We are really sorry about the issue! These hacks are now rolled back, all the solutions which were hacked now seem to be accepted.

We should have worked harder on checking the correctness of all the checkers, validators and solutions. We will do our best to avoid further contests to have such major issues.

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

The editorial is published.

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

What's the recommended order for solving problems in a contest? Do we start with the easiest problem A first or is there a smarter strategy?

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

Test case 5 of prob D:

10

9 6 8 5 5 2 8 9 2 2

Answer given is 9. But shldn't it be 10? {6,5,5} forming one subsequence and rest all nums for the other.

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

I try to hack and all the website says is this: http://i.imgur.com/aoSKkAM.png

Anything I Should do?

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

Please ignore this. Doubt was resolved.

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

F isn't original. In fact, I've used the same idea in a contest in our school around three years ago. Also, it can be solved by link/cut tree in time, which is better than the solution in the editorial.

But since it's an Educational round I don't think the tasks have to be original. I've seen other tasks in ECR that are obviously not original as well.

My code can be found here. You can see my poor coding style back then(therefore I had lots of trouble getting the input format fitted, even though there's only a little to be modified).