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


Привет, Codeforces!

Сегодня в 17:15 по московскому времени состоится финальный раунд чемпионата КРОК 2016, в котором 50 лучших участников отборочного раунда будут соревноваться за ценные призы, а также просто ради удовольствия. Призы лучшим в Финале:

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

А победителем игрового тура стал Belonogov, который был награжден призовым фондом 50000 рублей! Поздравляем!

Для всех остальных завтра в 19:35 по московскому времени будет проведен Codeforces Round #347 на почти идентичном наборе задач. Это будет обычный нерейтинговый раунд, отдельный для каждого дивизиона.

Задачи для вас подготовили Евгений Вихров (gen), координатор всея Codeforces Глеб Евстропов (GlebsHP) и я. Также хотелось бы поблагодорить Михаила Мирзаянова (MikeMirzayanov) и всю команду, работающую над Codeforces, за замечательную платформу, а также Александра Фетисова (AlexFetisov) за прорешивание задач.

Во время финального раунда для зрителей будет доступно текущее положение участников по специальной ссылке, которая появится здесь, а задачи вы сможете увидеть только завтра.

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

UPD 1: Ссылка на текущие результаты Финала: http://codeforces.com/spectator/contest/662/standings

UPD 2: Codeforces Round #347 будет нерейтинговым.

UPD 3: Разбалловка
Div 1: 500 — 1000 — 1500 — 2500 — 2500
Div 2: 500 — 1000 — 1500 — 2000 — 3000

UPD 4: Поздравляем победителей!

Финальный Раунд чемпионата КРОКCodeforces Round #347 (Div 1)Codeforces Round #347 (Div 2)
  1. tourist
  2. vepifanov
  3. riadwaw
  4. PavelKunyavskiy
  5. Merkurev
  1. Petr
  2. ilyakor
  3. step5
  4. Endagorion
  5. gs12117
  1. unused
  2. Pakalns
  3. yao981113
  4. yeguanghao
  5. hzq84621

UPD 5: Разбор задач: http://codeforces.com/blog/entry/44408

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

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

Finally, a rated round :D

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

best 50 participants from the Qualification Round will be competing

I think you mean Elimination Round..

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

So, perhaps some people will have privilleged information about the problems appearing in the rated round tomorrow, e.g. friends of the 50 people competing today.

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

    Exactly! I'm going to send the problems to everyone I know ohwait pretty much none of them compete these days

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

Финалисты могут рассказать другим о задачах. Вы думали об этом?

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

    Авторы контеста тоже могут рассказать задачи другим. Думаю, что финалистов попросят этого не делать.

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

      ну если авторы кому-то расскажут задачи, то они больше не будут составлять задачи..

      вообще не очень понятно, зачем так разносят раунды?

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

        Для того, чтобы избежать лишней нагрузки на Codeforces во время онсайта.

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

Won't the problems be harder than usual?

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

Well I have to say that if the problems are going to be almost similar you want to make sure to block everything related to this contest until tomorrow.

If you click in the profiles of any of the contestants you can see the submissions they made for this contest...

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

who is the champion? I cant open the standings page :(

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

"Everyone else will be able to participate in Codeforces Round #347 tomorrow at 19:35 Moscow time that will feature an almost identical problem set. It is going to be a usual rated round, separate for each division." There are something error? I've seen the code of tourist and everyone else, and the problem are the same :)

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

Завтрашний контест отменяется?

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

how to solve D?

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

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

    Well D was truely what you call a brilliant problem, try reversing the queries (like in problem Parking Lot (480E)) it will be really easier, since everybody may not want to see the solution see it at previous edit.
    EDIT: Oh !! i just noticed that you guys that didn't participate onsite (well i did) could be lying that you saw the problems :OOOOOOO !!!! >_< !!

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

Saw a funny bug after the rating updates:

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

a link to the position participants not working

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

Cheat...

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

ADMINISTRATORS PLEASE STOP IGNORING. REPLY ANYTHING ABOUT PEOPLE WHO SAW PROBLEMS' CODES
IS THE CONTEST GOING TO BE RATED OR NOT? IF RATED THEN HOW?

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

    Stay calm my friend :v

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

      It's like all admins went to sleep or something. Standings page is broken. Winners haven't been announced. No one commented anything about leaked Accepted codes. Do they want to run the contest anyway but don't want to say that?

      Funny thing is that my comment might get deleted now. I once commented "Seriously? Delay?" and they deleted it after 1 minute.

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

        Please, stop complaining Mahmoud . You are not the only one who is confused about the contest .

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

GOOD JOB Belonogov!!!

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

A rated contest after a while !

»
8 лет назад, # |
  Проголосовать: нравится -260 Проголосовать: не нравится
Комментарий удален по причине нарушения правил Codeforces
  • »
    »
    8 лет назад, # ^ |
      Проголосовать: нравится +423 Проголосовать: не нравится

    You have just greatly complicate the life of Codeforces and generally behave like assholes. It sometimes happens that something goes wrong. Making onsite events — a very complex activity. Codeforces team worked ~32 hours with 4 hours sleep break to make CROC Final, and we really wanted to make it not only for 44 participants but for all community. Most organizers do not make such events like: parallel rounds of onsites but Codeforces hold them many times. It is difficult and requires huge effort, but we did it to give the contests for community.

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

    Why do you do like that,people aren't competing for rating,they are competing because they want to solve the problems by themselves and see their level,just be honest with you and don't look at the problems/solutions.Respect at least the people who give you opportunity to compete with others in a contest.

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

    Codeforces rule #1: Don't upset mike.

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

    What was in this comment?

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

      As far as I know, there were links to the solution sources.

      UPD: sorry, looks like I'm wrong and the comment with links was actually deleted.

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

      links to touris's solutions. ..

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

      I could send you a screenshot but I guess that would be a "CF rules violation"
      No, I didn't post links. The comment of the guy who posted the links was simply deleted (not partially deleted and kept for voting)

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

I don't see why it was necessary to create a rated round with identical problem set a day after. Unless it's a mirror round in real time I don't see how it would work well — information always leaks.

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

    It seems now we have to do the round unrated. It is really pitty. It was my mistake that I accidentally opened the solutions for 15 minutes. I upset the behavior of some of the participants who did not give opportunities to others to fully take part in the round. I involved in programming contests for 15 years and I'm sure that this community rests on mutual respect and honesty. Yesterday it was impossible for us to run round in the same time or just after the Finals.

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

      Why???

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

      any chance of changing the problemset a bit ?

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

      I understand, but sadly it takes just one person to ruin it for everybody. Hopefully the unrated round will still have high participation

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

        I'm sure now that it's unrated more people will participate, because they will be sure that someone beating them because he has the codes wouldn't affect their rating.

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

          well I dont know about Div1 but this would not affect Div2 guy's rating that much if you didnt spread it :| being in top 100 in Div2 would likely increase your rating and before spreading it at most 10 people had the solutions . i dont see that much effect . also it would be obvious that a Div2 guy cant solve all the problems so fast and it would be easy to catch cheats

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

            oh really? how much did I spread it?
            I'm not saying "CF is bad". it's just that the contest simply can't be rated if atleast one participant has the codes. And even if you catch someone who "obviously cheated", he can change the code and you won't have a proof for that he cheated (unless you want to do like Mike did with my comment that "violated CF rules")

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

              yeah well i can say that the writers of any contest can give the problems to their friends and no one can prove they have cheated ... i am not saying it's a good thing people saw the solutions but since the number of such people is so low they can be ignored

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

        Well, Codeforces has a great history of conducting such rated rounds after onsite events, and usually it works ok. As for this round, two factors combined: Mike's mistake (that happens sometimes, we all are humans and perform mistakes) and dumb behavior of some members of community.

        Shit happens, at least trying to conduct a round is better than doing nothing at all.

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

So there are going to be people in today's contest that already have the solutions for the problems? If today's problem set is identical to yesterday's, then they should probably call it off since there will be people that cheat their way to the top. Kind of unfair, hopefully there's some solution to this.

Edit: Looks like MikeMirzayanov is just going to make it unrated. That sucks, but I guess it's the best solution.

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

I've been waiting for a rated round sooooo long. Huh...oh wait my luck just steped in. U know what gray kinda suits me.

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

not rated :(

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

i think unrated contest is the best solution in this situation because the solutions have been revealed

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

The announcement still says "usual rated round" . Which is it rated or unrated ?

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

Any chance for changing problemset a little bit?

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

Can the problem set of Educational Codeforces round be used? It is going to take place in just a few days.

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

    Nice Idea!!!!!

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

    Generally speaking, the problems in an Educational Codeforces round are some of the more "classical" problems unfit for a regular contest. In any case, it would not be a good idea anyway, changing all the problems last-minute.

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

      I think Codeforces must be having some tested-and-ready-for-programming-contest problems. They can be used. Please have a rated round :|

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

    maybe we can make the Educational round rated, it would be sad to wait for another two weeks to participate in a rated round :(

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

    I think this may be a good idea. If necessary they may delay the round. After all, it has been a long time since a rated contest .

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

In my case, I will take part on the contest if it is unrated, since being rated makes mee feel unconfortable given the situation. Being rated or not, trying to solve the problems is interesting.

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

Mike , can we please have a final confirmation from your side , that round will be rated or not ??

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

Это будет обычный нерейтинговый раунд

Обычный раунд не может быть нерейтинговым... =(

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

Mike, can we please have a final confirmation from your side whether the round will be rated or not , it will greatly resolve the confusion ...

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

So bad>_<... Can't participate in any rated contest in long time. TAT

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

Codeforces Round #347 will be unrated

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

Got too excited after seeing a rated codeforces round :v But, UPD 2: this round will be unrated :( Have to wait :(

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


And that was the reason why, on 4/16/2016, I decided to quit competitive programming. Good bye CF community!

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

too many unrated rounds recent times :(

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

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

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

"It is going to be a usual unrated round, separate for each division."

Once upon a time rated rounds were usual not unrated ones.....

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

people calm down it isn't that big of a deal. first, tweety did nothing wrong in fact he was making sure the rules weren't violated. second, so a rated round turned unrated so what I'm gray I'm dying for a round and still I'm not bothered by the fact that someone turned it unrated (what would you all do if it was mike who said there were leaks and the round will be unrated???) third, I can't believe that the whole CF community was shaken by such a small mistake.

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

A, B, C was tasks for improve realization) LoL)))

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

And after all this mess tweety did't participate :3 .

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

Спасибо за испорченный раунд. Алсо, почему-то уведомление не дошло, заметил его только на странице задач.

Как решается С?

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

Codeforces should hold more rated contests and soon, as there is clearly a lack of rated contests. We finally a rated contest, and even that becomes unrated. :( Something has to be done about this.

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

All of us might feel bad that we lost a rated contest. I agree with you'll, even I was waiting desperately for a rated contest. However, we need to look at the bigger picture guys/gals. There was a solution leak a day in advance.. this is a major mistake and something should have been done about it earlier itself. Instead, all moderators and codeforces team decided to ignore the mistake and just remain silent and let a contest full of cheaters and wrong solutions take place.

I guess this is very wrong. It almost becomes a matter of luck something like "I saw the solution its my lucky day! let me increase my rating.." Then some guys like Tweety prevented this from happening and made people aware that the soultions are available and have been leaked. They , tired of the silence from codeforces moderators decided to share their codes so that such cheating does not happen. For me , tweety saved me. I prefer a unrated contest than such cheating happening behind ignorance and a wall of silence. Thank You!.

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

    All hail tweety our saviour/ martyr (because some of his upvoted comments were deleted).

    On a more serious note, I totally agree with you. I was going to participate blindly if it wasn't for tweety, and I would've probably lost a lot of my points because I didn't know that the solutions were leaked.

    Let's all remind ourselves that it wasn't tweety who leaked the solutions. He was the one to draw attention to the fact, refusing to stand by while a few individuals took advantage of the situation.

    The organizers might not like him for that, but it is something very common to have a scapegoat around for your screw ups and what better scapegoat than the one who drew attention to their mistakes in the first place.

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

I hope, next really rated round will be soon..

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

My hacks B:

Test: (0-5 ones)3098, Answer: (1-6 ones)3098

Test: (0-5 ones)3099, Answer: (0-5 ones)3099

Test: 099999999, Answer: 1099999999

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

Good test on Rebus:

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

Worse contest ever :( Really worse problems...

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

Why is everyone angry i can't believe that doing the good thing can make u hated a lot Really "no good deed goes unpunished " Tweety did the right thing reporting the cheaters For all we know the ones who are saying ban tweety could be one of the cheaters

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

I think tweety need to do rated contest. Let it be his apologize to the community.

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

    I think that the one who accidentally left the solutions open to the public should make a rated contest soon.

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

Could you publish the onsite results now?

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

The moment I see the word 'unrated', I just want to cry :'(

Why? Why? Why? And why?

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

Haha I solved a totally different problem on B.

Given a list of abbreviations in order, find the smallest year matching each that hasn't been used before.

I didn't get that the queries were independent and only realized the true intent of the problem after an unsuccessful hack. I guess I tried to go too fast this time :)

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

Could anyone share their idea how to solve Div1 E?

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

    Here's a sub-problem:

    you are given at most 200000 "selected" 20-bit numbers. For each possible 20-bit number and each number k, find how many selected 20-bit numbers differ from this number in exactly k bits. This is done using DP.

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

    You can compute freq[x] = number of times the bitmask x appears Also, compute cost[x] = min of (number of 1s, number of 0s).

    You want to compute minimum over all j of the sum freq[j^x] * cost[x] (i.e. we flipped the rows according of to the bitmask of j).

    You can compute sum freq[j^x] * cost[x] for all j in n*2^n time using a variant of fft. (You can see the editorial here: https://www.hackerrank.com/contests/back2school14/challenges/xor-subsequence for code).

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

    An approach slightly different from the one described by Petr (might be easier to come up with, but is much slower): let's iterate over the first 13 bits. If the first 13 bits are fixed, each number becomes pair (distance on the first 13 bits, last 7 bits) — there are only 27·14 such numbers. So, with this we can iterate over the last 7 bits and solve the task with brute force. The number of operations is 213·(100000 + 27·(27·14)), which is small enough.

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

    Obvious but slow solution: fix a mask of rows that we're going to flip. Now, for each column we can achieve min(ones(column[i] ^ rows_mask), n - ones(column[i] ^ rows_mask)) ones (^ is XOR operator, ones(X) is the number of bits equal to 1). Compute the sum of these values for all columns and find a minimum over all row masks. The complexity is O(2n·m).

    Optimization: Split the rows into two groups of sizes A and B. Iterate over all masks of rows from group A and let's assume it's fixed now (and equal to X). For each column compute how many bits are equal to 1 in XOR of X and that column (let it be C[i]) and also let R[i] be a mask of remaining B rows for that column. Let's compute how many columns have the same values of C[i] and R[i] for all pairs of (C, R) (the number of these pairs is A·2B). Now, let's fix the mask of rows from group B (let it be Y) and iterate over all pairs of (C, R), each group will contribute min(ones(Y ^ R) + C, n - (ones(Y ^ R) + C)) * cnt(C, R) to the overall sum. Notice that we actually don't need to iterate over all pairs (C, R) as it's enough to compute prefix sums for all C for a fixed R and then we can compute the minimum in O(1) using them. The complexity is O(2A·(N + 22B + 2B·A)) assuming that ones(X) works in O(1). To choose A and B properly I just used a simple for loop that tried all possible pairs, although one could easily find it on paper (e.g. for the max test the optimal values are A=12 ans B=8).

    UPD: ilyakor has already mentioned this approach without prefix sums

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

      Thank you all a lot for three completely different solutions!

      @Petr — I tried this approach during the contest, but didn't manage to do the DP — It's good to know that it's possible to finish that and now it's clear from your code how to do it exactly, thanks!

      @Lewin — wow, I didn't expect anything like that

      @ilyakor and KADR — indeed, your approach is slower, but surely easier to come up with, nice!

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

Очень жаль, что раунд не рейтинговый. Ждём следующий раунд с нетерпением!

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

Below are 2 codes for DIV2 C

http://codeforces.com/contest/664/submission/17351450 above solution passed pretests

http://codeforces.com/contest/664/submission/17351613 above solution gave tle on pretest 1

What is causing code 2 to run slower than code 1?

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

    Although due to mis-understanding the constraints of the problem, my code failed the system testing, but my code passed pretests and your's gave TLE on pretest 1 because your preprocesing loop, the one filling the map, runs for ~(2*10^5) times. Mine runs exactly half of it.

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

It's so sad to know the contest is unrated after it finished for a student who stay up late to be a Candidate Master:( If I know it's unrated I'd chosen to go to bed early.

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

I has been long since the last rated contest. Please make the upcoming Educational Round rated. Rated contests are definitely more fun.

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

It has been long since the last rated contest. Please make the upcoming Educational Round rated. Rated contests are definitely more fun and challenging.

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

when will sytests start ?

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

How to solve this problem: http://www.codeforces.com/contest/664/problem/B Unfortunately my solution got hacked. Can anyone tell me the correct approach? Thank you

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

    just make every integer 1,then make one integer bigger if it makes ans more closer to n,until it can't be bigger or equality holds and do the next integer

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

It's so sad to know the contest is unrated after it's finished for a student who has stayed up late to be a Candidate Master:( If I knew it's unrated I would choose to go to bed early

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

Why the compiler doesn't execute a lot of problem A c++ solutions?

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

Что означает "Отказ тестирования"?

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

It would have been much more fun if the contest was rated. Anyways good contest !

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

Хммм... Я получил на A "Отказ тестирования". Вроде бы это означает, что я читак и копипастник, но: 1) Это не так; 2) Задача такая, что много решений будут иметь такой же вид.

P.S. Отбой, все норм.

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

Lol, only two people in my room managed to solve 2 problems)

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

    If I'm not mistaking, problem C from div2 has only 3 pretests (and you know 2 of them from statement). It means that contestants should not rely on pretests :D

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

What is the logic for DIV 2 C ?

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

    We have string representing our "short year" (call it S). Let's denote ans(S) that calculate answer. Fact: if we have suffixes of S S1 ans S2; |S1| < |S2| then ans(S1) < ans (S2). So we can build answer suffix by suffix. Assume we built answer for suffix Si (|Si| = i; ans(Si) = Ai). So A(i + 1) > A(i). A(i + 1) % 10^(i + 1) must be equal to S(i + 1) % 10^(i + 1) and A(i + 1) must be minimal. We can represent A(i) as k * 10^(i + 1) + r (0 <= r < 10^(i + 1)). Now we have 2 cases:
    1) S(i + 1) % 10^(i + 1) > r. Then A(i + 1) = k * 10^(i + 1) + S(i + 1) % 10^(i + 1). Easy to see that A(i + 1) correct answer.
    2) S(i + 1) % 10^(i + 1) <= r. Then A(i + 1) = (k + 1) * 10^(i + 1) + S(i + 1) % 10^(i + 1).
    Now if we assume A(0) = 1988, then A(|S|) = ans(S).

    Example. S = "015".
    A(0) = 1988 = 198 * 10 + 8. S1 = 5. 5 <= 8 => A(1) = 199 * 10 + 5 = 1995.
    A(1) = 1995 = 19 * 100 + 95. S2 = 15. 15 <= 95 => A(2) = 20 * 100 + 15 = 2015.
    A(2) = 2015 = 2 * 1000 + 15. S3 = 15. 15 <= 15 => A(3) = 3 * 1000 + 15 = 3015.
    So answer for S = "015" is 3015.

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

    You want to know what number chose that suffix. Simple observation from that is that each suffix of the suffix (except itself) was chosen before.(otherwise there was at least one smaller than itself,and it wouldn't choose it).

    Now this is how I find the number. Let's take 3098 for example. You can also see that one which chose 8 is before the one who chose 98. Now the greedy approach is simple.Calculate who took the suffix with length 1,call it VAL. Calculate who took the suffix with length 2 and it's >VAL,... and so on. If you want to find the number which has the suffix p,the number looks like prefix+p (0<=pref<=inf).

    In my solution I just binary searched prefix,and took the prefix which gave the smallest number > VAL. I saw other people just brute-force to find prefix(even if for prefixes of length 1 and 2 it takes some hundred steps,for other lengths is seems like it takes maximum 10).

    Hope I helped you understand the greedy approach.

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

    Example: IAO'1999 => from right to left: 9 => 1989 | 99 => 1999 | 999 => 2999 | 1999 => 11999

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

Can upsolving be enabled for the official contest? In particular one problem is not shared (Gambling Nim) and I want to submit for it.

EDIT: It's been enabled!

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

So much drama in one blog

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

Есть разбор задач?

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

How to solve Div1C / Div2D : Graph Coloring ?

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

    well , we have two options for the final color (1 — red , 2 — blue )

    suppose we want to color the graph with red

    for each component this is the algorithm :

    suppose we have a vertex v in this component .

    again we have two options : change the color of all edges adjacent to vertex v , or don't do anything with v .

    when you choose this option , you can run a dfs from this vertex , and you will know for each vertex of this component , what you should do with it ... (change it or not)

    after that , you know what to do with the vertices of that component :D ( while running dfs , if you changed one vertex , you can mark it in a bool array or sth ..)

    now you can easily know , what would be the color of the edges of this component ... (by using the information of each initial edge and the bool array we used) .

    if all of them were equal to the final color (here it is red) , add the changed vertices to a list.

    now , after you tested the 2 options for each component , if just one of them worked , just add it the the list of vertices for the final color which should be changed .

    if both of them worked , add the one with the minimum number of vertices

    and if none of them worked , sadly we can't color all of the edges with this especial color ( which was red here)

    now do the same thing for the blue color

    if you had 2 final list , print the one with minimum vertices

    if you had only 1 list , just print it

    if you hadn't any , print -1 :D

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



That's why I hate Dynamic Scoring..

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

Hopefully we will get the editorial soon.

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

Will there be an analysis of all the problems?

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

Can anyone tell me why the following approach fails for D div.2 (Graph Coloring):

  • pick any node and test 4 configurations: flip or not flip the node; try to color all edges to R or B
  • perform a bfs and flip nodes to obtain correct edge color (all nodes are processed once)
  • if at the end all edges are of the same color, then this is a correct solution
  • find the one with the least flips

By flip i mean change all edge color going from and to the node. Is the approach correct? Maybe I have an implementation problem.

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

Why Petr didn't participate?

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

Any Idea for solving DIV 2 D , using DSU ?

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

Hey, for problem "To hack or not to hack", the tests are really weak, aren't they. I do a very silly greedy and still pass: Iterate through the list and try to minimise anyone higher. Is there anyone else having the same idea?