Автор yummy, 8 лет назад, перевод, По-русски

Привет, Codeforces!

Отборочный этап чемпионата КРОК 2016 состоится в пятницу 18-го марта в 19:35 (московское время).

После нашего крайнего раунда, Yang Liu (desert97), Michael Kural (pi37) и я поняли, что мы еще не завязали с подготовкой раундов. Мы объединили усилия с Kevin Sun (ksun48) и Daniel Chiu (waterfalls) чтобы предложить еще один раунд для вас.

Этот раунд будет сразу для обоих дивизионов и будет состоять из 7 задач. Те из вас, кто прошел Квалификацию и зарегистрирован на Чемпионат примут участие в официальной редакции, остальные — в неофициальной (открытой для всех). Обе редакции будут рейтинговыми. Как всегда, вас ждет путешествие на тракторе в Бовинию с фермерско-алгоритмическими приключениями в компании фермера Джона, Бесси и ее лучшего друга Элси!

Перед стартом хочется поблагодарить GlebsHP за блестящую работу в роли координатора. Глеб, без тебя не было бы никакой надежды провести этот раунд! Так же наша благодарность MikeMirzayanov и всей команде Codeforces за создание клевых платформ Codeforces и Polygon. Наконец, мы безмерно благодарны abacadaea за помощь с идеями задач, а winger и AlexFetisov за прорешку раунда.

Формально, будут проведены два раунда на одном и том же комплекте задач (оба раунда рейтинговые):

  • КРОК 2016 — Отборочный Раунд: для зарегистрированных на Чемпионат участников, кто прошел Квалификацию,
  • КРОК 2016 — Отборочный Раунд (рейтинговая неофиц. редакция): для всех остальных.

Вы можете принять участие в Раунде официально, если на момент регистрации в нем вы зарегистрированы на Чемпионат и решили в Квалификации хотя бы одну задачу. Еще раз напомним, что независимо от формы участия, ваш рейтинг будет обновлен по результатам раунда. Единственная различие — в случае успешного выступления официальные лучшие 50 участников будут приглашены на Финал в Москву. Организация поездки (билеты, гостиница, виза и всё остальное) — это полностью забота финалистов. Участникам Финала КРОК-2016 будут покрыты транспортные расходы на сумму не более 10000 рублей (предполагается проезд обыкновенным купейным вагоном, либо, по согласованию, эконом-перелет самолетом). До 25-го марта необходимо будет подтвердить желание и возможность принять участие в Финале. Участники Финала будут бороться за призы:

  • 1 место — 100000 рублей
  • 2 местo — 70000 рублей
  • 3 местo — 50000 рублей

Мы еще обновим пост информацией о разбалловке.

Надеемся, что вам понравятся задачи и наши коровоориентированные тексты. Удачи!

UPD3: Так как примерно 15 последних минут соревнования тестирующая система некорректно обрабатывала попытки по F в раунде "КРОК 2016 — Отборочный Раунд" (и это отдельная интересная история как так вышло), вы можете обжаловать ваше изменение рейтинга, если влияние этого инцидента на ваш результат велико. Если вы отсылали F в последние 15 минут и имеете веские аргументы почему некорректный вердикт (WA/RE на тесте 1) сильно повлиял на ваше место, то напишите MikeMirzayanov и ваше участие можно будет сделать нерейтинговым. Приносим извинения за эту накладку. Апелляцию надо написать до 02:59 20-го марта (московское время).

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

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

Hope for hard data structures!

  • »
    »
    8 лет назад, # ^ |
      Проголосовать: нравится -93 Проголосовать: не нравится

    Why am I getting so many downvotes? Does everyone else here just want math?

    • »
      »
      »
      8 лет назад, # ^ |
        Проголосовать: нравится -20 Проголосовать: не нравится

      I guess it`s because of your quite egoistic message. Tastes differ, so you shouldnt write about things that are really loved by small piece of community. 5-10% wants hard data structures (about 40% hate it, so they downvote) and 99% wants nice problemset. P.S. hope you uderstood what i had wanted to say

  • »
    »
    8 лет назад, # ^ |
      Проголосовать: нравится -22 Проголосовать: не нравится

    I do hope too. Constructive-only problems are lame in most of cases.

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

Will ratings be updated differently for both editions ? Or final rating changes would be based on combined leader-board of both editions ?

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

    I think it is unreasonable to rate differently for the two rounds.

    • »
      »
      »
      8 лет назад, # ^ |
      Rev. 2   Проголосовать: нравится +47 Проголосовать: не нравится

      Seems like they will rate differenly since there are two different contests. I agree that it is unreasonable, it is stupid to rate differently just for having opportunity to go finals or not!

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

        Well, things like hacks and separate scoreboards mean that the contests are not the same. It's similar to the three versions of the 8VC finals.

        Also yes problems should be sorted, why wouldn't they be?

        • »
          »
          »
          »
          »
          8 лет назад, # ^ |
          Rev. 2   Проголосовать: нравится +37 Проголосовать: не нравится

          I think it is not the same thing because in 8VC people seperated by their score at contest before, also there were different problemsets for each round.

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

MooooOOMOoOOOOMOoOOOoMOOoOooMOooOoOMOOooOOMOOoOoo

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

7 problems and 2 hours ? :(

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

    Possibly not. We aren't sure about scoring or time yet. Please do not feel any angush over this! When the contest rolls around, we are sure that you will be amoosed by our puns.

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

      You've got 10 hours before it begins and you can't provide the duration?

      I'd really appreciate that info — it's hard to decide whether to compete or not without that information...

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

I think that there should be one contest and you should just select first 50 registered participants to go to the finals.

»
8 лет назад, # |
Rev. 2   Проголосовать: нравится -21 Проголосовать: не нравится

Oh thank god! A rated contest is here.

Btw, I registered, but I am unofficially participating. Will the round be rated for me then?

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

    please read the blog post carefully once instead of asking so many questions and remaining confused all the time...this is not specifically for u.. for everybody in genereal...

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

finally rated round.

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

После нашего крайнего раунда

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

В случае если кто-то из топ50 откажется от поездки на финал, будут ли приглашены дополнительные участники, занявшие последующие места?

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

lol now it becomes really messy !

the registration for IndiaHacks 2016 is started i registered in Div1 contest what would happen if i become Div2 in this contest ?

»
8 лет назад, # |
Rev. 3   Проголосовать: нравится -49 Проголосовать: не нравится

nothing. thanks for reply and votes..

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

is there a way to submit my solution after the contest is finished ?

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

А если я в обоих зарегался, у меня рейтинг на x2 изменится?

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

I think the division of the contest in two is not a good idea.

Right now I can opt to register to either of the two contests. I could register to the Unofficial Round OR I could sign up to CROC Championship and then register to the Official Round, because I passed Qualifications. Basically, I can pick who I want to compete against. This isn't fair.

Couldn't you make a single contest and then filter (or just handpick) the top 50 participants that meet the requirements of participating in the Final Round?

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

    Totally agree.

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

    In the last minutes in the qualification round jqdai0815 re submitted a wrong code in first problem which passed the pretest so that fail and not be qualified and he now registered in the unofficially version of the Elimination round, while the official round has 7 LGM and many other great coders.

    I do not mean that jqdai0815 can not compete well in the official version, we all know who jqdai0815 is, but I think is it not fair to have 2 separate versions of the contest and 2 separate standing which will make one of them easier than the other one, and become in the top 10 ( in the unofficially ) much easier than the official.

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

Hopefully I can handle these problems lol. Otherwise I guess I'll be dropping back to Newbie again.

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

Good luck

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

Могут ли авторы сказать, как они валят хеши в задаче С? Я выбирал не самые стандартные модули и не самые стандартные основания, но все равно большая часть валится на разных тестах. Я знаю методы подбора антитестов против конкретных параметров, но чтобы по случайным модулям валилось — вижу впервые. UPD: Не в тот пост, это про задачу С из квалификации.

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

    Кажется, тут заслуга не авторов, а парадокса дней рождений. Вы используете единственный модуль порядка 109 на тесте, на котором у вас 105 различных ключей. Вероятность что какие-то два дадут коллизию очень приличная (больше, чем , например). Я даже как-то писал об этом развёрнутый комментарий: link.

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

      согласен, для 100000 разных строк вероятность ОТСУТСТВИЯ коллизий: ( (2^32-1)/(2^32) ) ^ ( 100000^2 ) меньше 10%

      Для 200000 разных строк вероятность ОТСУТСТВИЯ коллизий ( (2^32-1)/(2^32) ) ^ ( 200000^2 ) меньше 0,01%

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

I passed the qualification round

and now when I register for the Unofficial Edition I get a message :

please register to the official edition , but I don't want :3

why you don't make one contest ? :\

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

    I think this is affecting the number of participants since only around 2500 people have registered so far in both rounds.

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

    I passed the qualification round and I registered for the Unofficial Edition, no problem at all

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

      may be because I registered for the official contest then canceled my registeration then tried to register for unofficial version

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

Seems like not much people are participating compare to other rounds,that means harder to climb rating Xp. But I will participate anyway. Hope this contest go well,nice and smooth for the round organizer and participants :)

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

will you merge the standings for calculate ratings ? or ratings will be calculated separately ?

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

My performance on Codeforces is getting worse:

I'm afraid today I can solve only 2 problems :((

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

I am hoping to see tourist surpass rating 4000.

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

I sure hope I won't get a rating change smaller than -40! (that's an exclamation mark, not a factorial)

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

Спасибо за разбалловку!

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

not able to submit E

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

The best problemset I've seen on Codeforces during the last time.

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

How is it I got WA on pretest #1 in problem F?

I did a custom invocation and the answer was OK. Does pretest 1 differ from the one in the statement?

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

    Same problem, 16795467.

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

    Got this response from jury:

    " We're really sorry, somehow the system broke in the last 5 or so minutes. It is accidentally running your code on G instead of F. Gleb is busy right now with other issues and we can't do anything about it.

    We really apologize. :("

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

      Ok, then if my solution is indeed correct, they should run it on system test and I should get the score for the problem. The same for all contestants who submitted it and got WA on pretest #1.

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

        Totally agree with you. I'm really surprised and frustrated about the fact that there wasn't some broadcast message about this problem — they clearly knew about it before I asked a question. That way me (and other people with the same problem) could at least spend last minutes doing something useful.

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

      Phew, that doesn't make my solution incorrect (unless it gave correct answers on the pretests of G, which is negligible :D).

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

      But for some people, they may be confused about the testing result and do useless things.

      They missed one or more chances to check their codes on pretests, which may be helpful to fix some small bugs.

      As for me, if the pretests ran well, I may be possible to fix "ans" to "(ans+mod)%mod" to avoid printing negative numbers. :(

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

    For me — RE: 16795457

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

    The same.

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

    Please, read UPD3. I'm sorry about it, it's my fault.

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

Systest when?

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

3 WA's on 3rd question. Is ternary search the solution? Also for 4th question, finding longest acyclic path in a dag and binary search? Would this work?

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

    For 3rd question, I used a sliding window for O(N) time. I'm not sure how ternary search would work.

    For the fourth, I binary searched until the graph was a valid one (that there was a valid ordering of nodes), but I think the way I checked graphs might be wrong. I found the winner of the graph (node without any parents) and continuously found the next best rapper.

    I got stuck on D for ~20 minutes because of a bug in my binary search T_T.

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

      I think you can check if unique ordering appears by searching for a hamiliton graph on that DAG, which equals topo sort while you can never find more than one node to remove each time.

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

    4-th: no binsearch. Longest path + review edges and stop when all edges on the path viewed

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

Seems like tourist is not going to get his 4k rating. UPD: He is. UPD2: He isn't. :(

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

How to do E?

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

You must be kidding...

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

Can robot rapping ordering competition be solved with dsu? :(

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

    you can find who is the winner with dsu but i dont think u can solve the whole problem

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

    I don't think so, because dsu assumes undirected edges, and the problem reduces to whether for a subset of the edges E, for each pair i, j of vertices either path exists i → j or j → i. The trouble with this of course, is a set of edges like , where dsu will conclude ok, but actually we don't know which if b or c is better.

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

      I found the mistake. Gotta upsolve :)

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

        I don't understand, why would the values in the two DSU values be the same for a graph where there exists an ordering? Do the values not depend on the way you break ties between two components with the same size when you merge them? And hence they could be different even for a series of matches which determine an ordering.

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

    It can be solved with binary search+topological sort in NlogN.

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

      You don't need binary search, actually -- once you sort the contestants with topological sort, the only edges you care about are edges between contestant number i and contestant number i+1 (in the ordered list). The number you should output is then the index of the last edge of this form.

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

      my solution using longest path is just O(V+E) (for the problem's limits = O(V))

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

        How did you do it without binary search ??

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

          find longest path (O(V+E)) and then review all egdes (O(E)) until they construct the longest path I found

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

At the end of the match, I received a message saying that your solution has been hacked or resubmitted. It had killed me until I realized after refreshing page a lot of times that, not my solution, but the solution I was viewing was hacked or resubmitted.

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

Something weird just happened, i sent my F code. it was correct for first 2 test. But i got wrong answer in pretest 1. Are you guys sure there is a checker?

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

    Yeah, the same thing happened to me. I think there's a problem there... I got correct answer in custom invocation too.

    At first I got TLE in Test 6, so I decided to optimize and submit again, only to get WA on pretest 1. I was like " What the...?! ". Maybe they have to recheck that...

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

    +1, same problem. Pretests can theoretically be different from samples, but why then don't we have minuses in the scoreboard?

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

    The same. Somebody should investigate it.

  • »
    »
    8 лет назад, # ^ |
      Проголосовать: нравится -47 Проголосовать: не нравится

    I think you forgot to delete blank line end of the output.

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

    It is strange, but it seems like this problem appears only in the end of contest. Nobody passes this problem after 01:47.

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

      They said that the problems appeared in the last minutes. My first submission 1:48:57.

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

        Yes, I have read that. I left this comment before Gleb told us about their problems.

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

    I submitted "cout << 5 << endl; cout << 16 << endl;" in 01:56:56, but this code get WA on pretest1....

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

    Please, read UPD3. I'm sorry about it, it's my fault.

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

Давай tourist 4000+

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

i solved C with ternary search can someone propose an alternative approach ?

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

    I applied sliding window and then binary search. I think I did some overkill with my bs as I did it two times for odd length and four times for even length, but wanted to be absolutely sure... Lets see what happens after the system testing .. an overkill or an overwaste :v

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

      The key is just to try ALL possible farmer's positions and for each of them cows' positions are easy to compute with a window sliding along with farmer's position

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

    I used binary search on covered range r. Then for each possible position i of the farmer in the array I checked if [i-r, i+r] could accommodate k cows and the farmer. With an array of sums it's possible to check each position in O(1).

  • »
    »
    8 лет назад, # ^ |
    Rev. 4   Проголосовать: нравится +9 Проголосовать: не нравится

    How you used ternary search?

    This is my approach-prefix sum of zeroes from left to right. Fill Closest_left_0_of_i array and Closest_right_0_of_i array, then use sliding window(or simply do an l=upper_bound() on zeroes array for each i where zeroes[i]>=k+1) to find the range [l,(r=i)] where they can fit, find midpoint of this range, and check the
    min( max(|l-Closest_left_0_of_i[mid]|,|r-Closest_left_0_of_i[mid]|),max(|l-Closest_right_0_of_i[mid]|,|r-Closest_right_0_of_i[mid]|).
    Take minimum over all i, and also for mid+1 in cases where l+r is odd.

    ps: Formatting here is a little annoying. One can't simply get to a new line with return alone.

  • »
    »
    8 лет назад, # ^ |
    Rev. 10   Проголосовать: нравится +2 Проголосовать: не нравится

    let "lf" be the left most room has been booked and "rh" right most and c the place of owner of cows.so the answer of problem( f(c) ) will be max( c — lf , rh — c).

    next[i] means next 0 room for room i.(left to right)

    first "lf" is the first 0 and "rh" is (k+1)th 0 and c is "lf" and do it until "rh" overflows:

    while( f(c) <= f( next[c] ) )  set c next[c] and set ans min(ans , f(c) )
    
    then set lf = next[lf] and rh = nex[rh]

    so you can calculate the answer with O(N)

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

The last two minutes were very intense... we got the only two "correct" submissions for the last problem during that short time. :P Anyway, this contest was a huge fail for me. :/

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

I have a query. If I submit a solution and it gets WA in pretest in test 2 and test 2 is included in samples. Will 100 points still be detected from my score?

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

I was trying to hack this solution for problem 645C - Покидая ферму

Code

My hope was on "v.erase(v.begin(), v.begin() + 1);"

Is it true, that std::vector can erase first element faster than in O(size) time? Otherwise, I don't know why test

100000 50000

0000...000

didn't fail this solution... =(

Can anyone pls help?

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

Tourist has now mastered the art of mind games! Again a last minute submission.

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

Пытался сделать взлом по задаче С, TL в условии 1с, в логе взлома написано — Time:1450, вердикт — Неудачная попытка взлома

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

About problem F, I think that all contestants who submitted a correct solution but got WA on Pretest 1 should get the score for the problem.

Please check who submitted the problem and got WA #1, then run those solution with full test case and see if they get correct answers within the time limit. If so, all that people should get score for the problem. It would be really unfair otherwise.

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

We are sorry but systesting will be delayed for a while. At the end of the contest we've noticed some technical issues that affected some participants. System testing and rating change is delayed until the full investigation of this case.

We decided to make the tomorrow round combined for both divisions, so you should be able to start to register.

We apologize for the inconvenience.

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

    A similar thing happened a few months ago, where the checker was wrong for one single test case. It was then decided that said test case should be ignored, and all solutions that got correct answer in the remaining tests got Accepted in the end.

    I think a similar course of action has to be taken here: All solutions submitted during the last 5 minutes should be run on Full Test Set for Problem F, and those who pass System Test should get the score for the problem. In case a user submitted many solutions with WA #1, I believe the first correct solution should be considered in order to minimize penalty.

    I don't know if all this can be done, I'm not very familiar with Codeforces system inner working, but it would be great if you could do it. Let's hope for the best :)

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

      Wrong answers on Pretest 1 don't count against your score anyways. =)

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

        No, but some users might have submitted their last solution many minutes later because they got WA #1, when actually the first solution was indeed correct.

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

    Estimated time till start of system test?

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

Per Codeforces tradition, we'll update this post with the score distribution just before the contest.

this is exactly codeforces tradition; saying that but then not updating anything

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

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

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

Pending system testing, same old story :3

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

Can somebody explain me problem D? I had only O(N^2) idea and then i stucked.

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

    Binary search on the number of edges and do toposort on it!

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

    Binary search the answer.

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

    binary search on answer. To check whether an answer is posible or not , just add those edges and see if a unique topological sort exists or not.

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

    Actually it's possible to solve it without binary search.

    1. Check if all matches give you unique answer. If not, print -1.

    2. If order is unique, let's assume that robot with index a_0 is better than one with index a_1, which is better than one with index a_2 etc.

    3. Create set {{a0, a1}, {a1, a2}, ....}

    4. Iterate through all matches and erase current match from set (if present).

    5. As soon as set is empty, we know the order.

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

    I didn't use binary search. I did a topological sort and then checked the maximum value of edges among consecutive vertices in toposort. Values of edges are index of match.

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

My idea for D (couldnt implement it tho):

Add all edges in the graph, then check if only 1 vertex has in-degree 0 (lets call it source). If there is no source or there are multiple sources, answer is -1.

Else, find farthest vertex from source (lets call it sink) using dp. If the distance from source to sink is N-1 then print the greatest edge in the path, else print -1

Is this correct?

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

    How are you finding k this way? You're basically checking if answer is not -1. Please explain, I think I misunderstood you.

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

      If the answer is not -1 , you can reconstruct the path from source (robot with greatest strength) to sink (robot with smallest strength), and check the index of all edges in this path. The answer is the edge with greater index.

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

        Got it! Since there can't be more than 1 edge with same u and v, and transitive property holds true, we can do this, because there can be at most one path with n-1 edges. Thank you for explaining :)

        Finally solved it with topological ordering.

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

        Could you please explain how to find the longest path from source to sink? It's not the first problem I couldn't solve because I can't think of a way to do it.

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

          This will get TLE. I then used topologial ordering to solve this(queueing 0-indegree vertices in a loop, and removing these vertices from graph(obviously their edges will go too) ).

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

      If you label the edges by their index, the value of k will be the greatest edge on the path with the most edges.

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

lol is solved D with binsearch + something like dijkstra or prim so it's O(nlog2n) not sure if it passes

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

То чувство, когда заметил #define int long long

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

If it was some problems with the system testing, does this round remain rated ?

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

What is wrong in this solution for problem D? I used binary search + topological sort. Verdict : Wrong answer on pretest 11. My Code

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

    As I can see, your isDist returns true iff there are no cycles? E.g. consider test 4 3 1 2 1 3 1 4 It looks to me your code will not output -1 though it should.

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

      My code give output "-1" and i think it's correct.In my isDist function when i'm doing topological sort,if i find more than 1 element in queue that means we can choose next element in more than one ways.So the topological sort must not be unique.So i return false.

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

I made 6 submissions by F and got 6 WA1. Now all my submissions are passed. Will you ignore my last 5 submissions?

UPD: Thanks, they are ignored.

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

    I think, jury should system test all WA#1 submissions and select the first passed (if there are such submits :D) as the final result.

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

      I agree. In that case there will be some participants who failed the problem (like muratt below). They will ask for unrated round.

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

        Yes, despite of the time of the issue (1:47) it has a big influence to results. You would have been able to check/debug your code, challenge somebody or even solve another problem. I got WA#1 (now Pretests Passed) at 1:47:30 and wasted 12 minutes, while rng_58 solved E at 0:09... (however, unfortunately I'm not rng :D )

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

          I think that about everyone who passed F will want rated round. Actually I think they will do what you said and ask for those who wants unrated round individually. On my mind it will be the best solution.

          But another problem is that this round is the elimination round to the CROC finals. Anyway we should wait for the decision of the administration.

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

            Is it possible to make the round unrated only for those affected by the problem?

            I, for instance, failed problem F because of TLE, but I believe I still want the round to be rated because I did pretty good anyway.

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

              I remember some such rounds. Let's wait for the decision of administration.

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

      What if participant found a bug, that does not appear in pretests? And resubmitted his solution?

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

      Such way allows to fix all bugs or speed up with no penalty, which is not honest too. Anyway, seems like there is no way to solve this issue absolutely honest.

»
8 лет назад, # |
Rev. 7   Проголосовать: нравится -7 Проголосовать: не нравится

After F's judged again i got WA in pretest 5. I found a bug after ~10 sec after WA

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

    Out of curiosity, what would your rank (approx.) be if it passed?

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

    Similar situation — my two WA#1's changed to TLE#7's; which can be trivially fixed by removing redundant "% mod" in the inner cycle. (actually, an interesting question why it takes 8 seconds on server — locally it was below 2 seconds even with this redundant mod (and "Run on server" functionality wasn't working in the last 5 minutes); does it mean that GCC compiler is actually GCC32?)

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

Solution for problem c: First precompute in o(n) for each place x "how many cows can I allocate if i own all places from 0 to x inclusive?" Now we have the capacity to ask in 0(1) how much cows I can allocate if I own places from any (a,b) just getting P[b]-P[a-1]. And to actually solve the problem we do a binary search "can I allocate cows making max distance to y?" We can answer this question in o(n). Test each position for the farmer's place and test if the amount of cows from the position -y to the position+y fits in k.

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

    Solution for problem c:

    First compute in o(n) for each room x "how many cows can I allocate if I occupy all places [0,x] inclusive?" store them as P[x]

    Now we have the capacity to ask in 0(1) how many cows I can allocate if I own places from any [a,b] if we calculate P[b] - P[a - 1].

    And to actually solve the problem we do a binary search can I allocate cows making max distance of y? We can answer this question in o(n). Test each position for the farmer's place (called W) checking if the amount of cows in the range [W - y, W + y] is higher or equal than k+1.

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

I am waiting for one day that contests come without delay :-"

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

What is the hack test for B? I solved it, buy I can't see some 'tricky' tests...

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

Enable upsolving please!

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

Do you forget to give permission to see other's solutions after the contest? If not why is it so delayed? This was the case for the last contest as well.

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

дорешать задачи нельзя?

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

Забавная вещь. У меня С прошла претесты. Судя по вердиктам(ВА на претесте 10) в комнате, в этой задаче было не меньше 10 претестов. На систестах у меня С упала на тесте 10! Решение Это из-за того что у меня есть переменная j вне цикла и также есть переменная j в цикле for(;;)?

UPD: Оказывается тест 10 на систестах и претест 10 отличаются.

UPD2: Решено, там были баги в индексах.

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

Seriously man! You don't change ratings, you don't let us upsolve, just sitting here refreshing cause too fresh to go to sleep. Stop wasting my time

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

So jqdai0815 was able to solve all problems in just 1:24 , this guy is the next big thing.

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

It seems like the ratings are finally updated! tourist got Problem G wrong! Petr went up 181 points and jqdai0815 went up 137 points, while tourist's rating went up, however only 14 points. It would have been interesting to see if these would be different if jqdai0815 had competed in contest as tourist and Petr...

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

Я решил сделать рискованную попытку по задаче С, не доказав почему мое решение будет работать. Оно зашло. Помогите пожалуйста разобраться, почему это: http://codeforces.com/contest/645/submission/16800705 работает. Я ищу указателем, куда могу поставить вторую корову, а потом беру медиану между номером нуля первой коровой и нуля второй коровы и смотрю все нули, номер которых отличается не более чем на sqrt(n) от медианы.

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

    Ну понятно, что это решение некорректно. Вокруг медианы не всегда будет оптимальный ответ. Тест, на котором это упадёт устроен например так:

    '0'*49998 + '10' + '1'*499998 + '0'

    Медиана в такой строке будет лежать около элемента 25000, блуждать вокруг неё нам не поможет. Конкретно ваше решение на этом тесте даёт неправильный ответ.

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

My submission got AC, but i found test, where my code failed

Problem : 645D - Репортаж Результатов Рэпа Роботов

7 6

1 2

2 3

3 4

4 5

3 6

6 7

My output: 6

Right answer: -1

Code : 16818709

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

Serious question: does the final round have English problem statements?

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

    Same question. This is what I found in the announcement page:

    "The official language of the competition is Russian.".

    But I think if there will also be a parallel round they will also have the statements in English.

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

    No. I mean the official round. The availability of English statements in final round will affect my decision of going to Moscow or not.

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

      It will be problem statements in English too. But I'd like to remind that your trip is completely on you (including visa, tickets, hotel booking and all other routine). For example, I do not think CROC can send you official invitation for visa, because it is formal process in Russia (including registration in special bureaucratic institution). In 2013 (or 2012?) rng_58 visited Finals and we were excited his visit. Hope to see foreigners on the Finals this year :-)