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

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

Привет, Codeforces!

Рад пригласить Вас на увлекательный (а мы постарались его сделать таким) Codeforces Round 748 (Div. 3) — раунд для третьего дивизиона, который состоится в 13.10.2021 17:35 (Московское время). Это раунд, сделанный мной (MrPaul_TUser), существенный вклад в его создание которого также внесли MikeMirzayanov и BledDest.

Этот раунд содержит 6-8 задач. Задачи подобраны по сложности так, чтобы составить интересное соревнование для участников с рейтингами до 1600. Однако все желающие, чей рейтинг 1600 и выше, могут зарегистрироваться на раунд вне конкурса.

Раунд пройдет по правилам образовательных раундов. Таким образом, во время раунда задачи будут тестироваться на предварительных тестах, а после раунда будет 12-часовая фаза открытых взломов. Мы постарались сделать сильные тесты — так же как и Вы будем весьма удивлены, если у многих попадают решения после окончания контеста.

Вам будет предложено 6-8 задач и 2 часа 15 минут на их решение.

Штраф за неверную попытку в этом раунде (и последующих Div. 3 раундах) будет равняться 10 минутам.

Напоминаем, что в таблицу официальных результатов попадут только достоверные участники третьего дивизиона. Как написано по ссылке — это вынужденная мера для борьбы с неспортивным поведением. Для квалификации в качестве достоверного участника третьего дивизиона надо:

  • принять участие не менее чем в двух рейтинговых раундах (и решить в каждом из них хотя бы одну задачу),
  • не иметь в рейтинге точку 1900 или выше. Независимо от того, являетесь вы достоверными участниками третьего дивизиона или нет, если ваш рейтинг менее 1600, то раунд для вас будет рейтинговым.

Огромная благодарность _c_k_r_, Vladosiya, Ahmed_Salama, BitHashTech, powergee101, ncduy0303, ashmelev, God_Of_Code, OlegZubkov, mahade31, arjunsanjeev7, и SmartCoder за помощь в тестировании раунда и улучшении задач.

Всем удачи и хорошего настроения!

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

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

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

Looking forward to an interesting round!

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

Hoping for a good contest :)

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

Looking forward to change my color :)

Spoiler

Plot twist:

Spoiler

Plot twist again:

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

My first unrated round.

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

Nevermind, but can someone remove cheaters in last round

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

Hello everyone! Good luck to everyone to write this contest and adjust the rating well!)

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

-1

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

    VERY UNPAIR

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

    It would be nice to recalculate the rating for honest users.

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

      +1

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

        It is sad(

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

        Did you just say "Shame!!!"? What in the world do you think gives you the right to say that? Even you know that it's not a right thing to say, else you wouldn't be cowering behind an alt.
        Please don't ruin the comments section of every blog you see. If there are some issues, create a blog or comment on blogs that already exist for that issue.

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

          -1

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

            So you think that it is fair not to remove the cheaters?

            Where did you see him say it is fair not to remove cheaters ? Aren't you making up the truth? Do you think it's fun to deliberately destroy the environment of the comment section? Aren't you ashamed of yourself? And you just put the blame on Codeforces?

            It don't even take 1 hour to remove cheaters & update the ratings but don't know why they are not doing this from last 2 weeks.

            Don't you know that admins have to do a lot of things every day? And how can you be so confident? Less than an hour? Don't you know how much manpower and material resources it takes to run a website? Do not know how cumbersome it is to process all the competition information of more than 20000 contestants and then calculate the rating? Take your brain before you talk, and don't talk nonsense if you don't understand these things, okay?

            Also, can you stop yelling "Remove cheaters! Remove cheaters!" in the comment section of each official blog? You think admins doesn't know these things? Don't know how many contests recently? Don't you know how much admins workload? Please, be considerate of others. You're happy to make others hate you, aren't you?

            I didn't want to say anything at first, but I can't stand seeing the comment section like this. I hope this is the last time I get angry about such kind of shitposts.

            Sorry for my bad English.

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

              As an ex-admin of several huge online projects, I would like to agree with EasonCF: you can't imagine what enormous amount of work such kind of projects require.

              And the subject of the problem is insanely ridiculous: cheaters? Does it really bother you??? Rating? Are you serious?

              You've got a lot of great CP problems WEEKLY! Great tests, fantastic database of solutions and editorials, archive, and what are you talking about: cheaters and rating??? Be ashamed!

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

    Can you create a blog for this problem??

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

Despite my earlier criticism , I have come to appreciate naman1601's light hearted memes under every contest announcement. I would request him to bless us with another light hearted meme.

P.S. He just became purple again. Everyone please upvote him as a congratulations.

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

Looking forward to increase my rating.

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

In div-3 do all questions have same score? Like A and F have same value upon solving?

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

It really hurts when rating is exactly 1600 :(

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

Hoping to be a blue coder to change my profile picture xD

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

ah yes, all that's left is to convince my parents to let me stay up till 1am.

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

Best of luck to everyone on this round!

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

But what if you're a beginner like me who hasn't taken part in two rated contests yet?

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

I hope everyone can raise rating

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

Allfather bless me so that my color changes (to the better side) this time.

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

Hi, Im New, but what languages will be accepted, like python c++?

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

Today is my birthday, and I will participate in this round.... Yoooo

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

Hope my color changes after this round ! )

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

It's cool that the penalty for a wrong attempt will be 10 minutes

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

I hope to stay newbie after contest :)

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

Good luck.

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

Hoping for change my color =))

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

As a tester, I tested…
GL&HF

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

I hope that the penalty of all contests will be 10 minutes instead of 20, not only Div3

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

I'm not reading Announcement comments anymore.. Man I feel too old

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

I hope my rating will reach 1900 after this contest Good luck !!!!

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

Any hints on F?

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

solved G faster than rainboy pog

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

Is D2 about iterating over the numbers which have more than half of the bits set in $$$[1,2^{N}]$$$ ?

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

hoooolly shit that was intense i accidentally solved D1 like how it should be solved in D2

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

:( ? Why D1. n<=40 but sum (n) <= 100 ?

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

Any idea how to do D1? I tried doing it by taking the GCD of all the differences of pairs but I was getting WA on test case 3

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

Quite interesting problemset! Thanks for this round!

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

Really nice D2

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

What the heck is this second test for E?

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

can someone help me by telling what i am doing wrong in Problem-E

solution link : https://mirror.codeforces.com/contest/1593/submission/131852543

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

I liked the problems, but this is really irresponsible behaviour. I understand sometimes issues may escape the testing phase too, but quietly changing the statement without announcements trying to not address the that there was an issue is not acceptable. I spent a lot of time trying to debug my initial submission, and finally when I couldn't believe that this was incorrect, I tried refreshing the page.

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

Isn't this solution correct for problem E

Number of nodes left = total nodes — number of nodes which have distance less than equal to k to the closest leaf node.

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

How to solve C?

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

    the cat moves exactly $$$n-1$$$ times, so the total times you can move a mouse is also $$$n-1$$$.

    To save as many mice as possible, always move the mouse nearest to the hole first. You can sort the array of the distance of each mouse to the hole, then try to save the mice from the nearest until the total distance exceeds $$$n-1$$$.

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

Looking at the hacks, I foresee many TLEs on E, especially for those that BFS from leaves and keep track of degree of the nodes

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

The problems were good but the samples were really weak

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

I know you are impatiently waiting for the editorial, so I've decided to share with you my easy-to-understand solution for problem A.

int t; cin >> t;
while (t--) {
    int a, b, c; cin >> a >> b >> c;
    cout << max(max(b, c) + 1 - a, 0) << ' ';
    cout << max(max(c, a) + 1 - b, 0) << ' ';
    cout << max(max(a, b) + 1 - c, 0) << '\n';
}
»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can someone help me figure out why am I getting a different output (which is one more than the required output) when on codeforces judge, but when I run it locally on my compiler it gives the correct output for the same test case.

Here is my submission

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

    Because you are including death[0] in your answer. death[0] is not set anywhere, so its value on your local machine may differ to that on the server.

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

      Nice catch, but after fixing that, I have a similar problem but this time a 3 instead of 1, I tested it on my compiler and it gives the correct result,

      Submission

      PS: I have realised my solution is incorrect but I still want to know the reason for the inconsistency in the outputs for future reference.

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

        It's very difficult to say for sure but I have (recent) experience of similar things and my finding has always been that I've been accessing something that I didn't mean to, or that I didn't think was there, by mistake.

        A hypothesis might be that your adj is not resetting itself in the same way online (since you are not explicitly clearing the elements). But I confess I cannot say for certain.

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

        You're setting some death[i] to be 1, but I think you might be assuming that the others would be 0, which is not correct.

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

Why multisource bfs isn't working in E?

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

Can Anyone Help Me Out to find why am i getting wa for problem E ,My Submission : 131857557

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

These types of Solutions are getting hacked with TLE, but it doesn't seem to exceed TL. This is O(KlogK) solution. Perhaps this is because of Java?

Correct me if I am wrong. Thanks.

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

    I don't use java much but Arrays.sort(a) in java has worst-case time complexity of order n^2. Therefore the worst-case time complexity of your program is n^2 which gave tle.

    You can read more here

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

      Oh okay, thanks for the information. So there are more chances of java solutions getting hacked whenever sorting is needed in the solution, right?

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

        Yes, you are correct. I have seen tons of solutions in java getting hacked on codeforces due to Array.sort(a). You should switch to Collections.sort(a) or suffle array before using Array.sort(a)

        Array.sort(a) uses quick sort only on primitive data types. So if there is no primitive data type Array.sort() is ok.

        An example of Collections.sort() can be seen here in the SecondThread solution

        Notice that he uses collections.sort and fastio for speeding up the code. Collections.sort() wont get hacked as the worst case of it is nlogn

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

Anyone else with the following on Test case 2 for E

wrong answer 37th numbers differ - expected: '1', found: '0' ?

What is this test case possibly? I did multi-source bfs starting with all the leaves of the tree.

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

It seems that D2 has many suceesful hack. Is pretest weak or some conercase ?

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

when I run this code on some other compilers like gfg ide, visual studio I get correct O/P for sample test case 1st but on codeforces I am getting W/A on test case 1st, IDK how this happens ??

Code:

https://ide.geeksforgeeks.org/zN7ERcyWaB

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

Anyone solved E in O(n) by finding 2nd largest length from every node to leaves?

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

Why there is so much hacking in E? Which test case it is failing???

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

    The majority of hacks seem to be time limit related, where the user has, K times over, created a whole new queue which could have size of up to N.

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

      How though? I believe only the new leaves would be added to the queue and that should be of the order of the nodes since any leaf would be added at most once.

      here's my code

      Sorry for the poor variable naming. Link to submission

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

Nice problems, but weak testcases. Thanx.

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

Were the weak tests on D1 and D2 on purpose? MrPaul_TUser

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

really strong tests

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

Some people hacked a lot of solutions, it's hard to read a lot of solutions (at least for me) and find which ones can be hacked and which ones are not.

I think there is a way to test a lot of solutions automatically. Is that true ? and is it allowed ? and do you have any idea how to do that ? it would be great if you can help.

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

I got wrong on TC2 on C (my submission).... Please help!

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

    If you would like a testcase that fails:

    10 1000000000 1 999999999 1000000000 1 999999999 1000000000 1 999999999 1000000000 1 999999999 1000000000 1 999999999 1000000000 1 999999999 1000000000 1 999999999 1000000000 1 999999999 1000000000 1 999999999 1000000000 1 999999999

    It has to do with not checking for your vector being out of bounds when you incremented i.

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

Here's my Solution to E 131874293. Do you guys have a better approach or this solution is fine.

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

    I think the algorithm itself is fine, and the implementation has room for improvement.

    deg is not necessary, you can use ar[i].size() instead.

    leafs and new_leafs can actually be vector rather than set

    And consider output '\n' for new line instead of endl since endl flush the output buffer each time, which may make the running time longer

    You can refer to my submission, which has basically the same algorithm as yours and has 3x faster in running time.

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

I have a serious concern about the problem A.

Is it fair to allow such submission getting AC?

To compare, this one gets TL. Of course, the only difference is the line 3: #pragma GCC optimize ("O0")

I guess that checker must prohibit the loop elimination explicitly when compiling the solution, because that's what GCC does in this case.

Would be nice to listen to the contest authors' opinion. cc MikeMirzayanov MrPaul_TUser

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

    Well, I'm kinda confused with people's reaction. Could somebody from those who downvoted to comment on that?

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

      Why in the world would getting AC by this submission not be fair? Modern compilers nowadays apply an overwhelming number of optimizations, you cannot know all of them for sure. Which of the optimizations must be considered "unfair"?

      Loop elimination is one of the simplest optimizations a compiler can do. If G++ is able to do it while others are not, well, one has to blame the other compilers for that.

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

        Which of the optimizations must be considered "unfair"?

        I didn't tell the optimization itself was unfair. And I know well what compiler optimization is.

        Also, I didn't participate the contest and I don't ask for some other people's solutions to be retested, etc.

        I'm just pointing out that the solution which presumes 10^13 operations to be performed gets AC verdict.

        Moreover, it does perform those when being compiled with -O0 or -O1. I guess, there's also some sort of flag to disable such optimization while having -O2 or -O3 enabled too.

        So my intention was to raise a question about potential elimination of those optimizations while testing a solution.

        Why? Because the compiler must not influence the correctness of the solution. And the solution above is wrong indeed, it must not be accepted as a valid one, IMHO.

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

          The solution is not wrong. It gives correct answers for all the tests. If it is compiled without optimizations, then it will get TLE, but it does not mean that it's wrong.

          But the question is: where is the margin between optimizations which influence correctness and optimizations which do not?

          If you really want to be sure that your code will not be affected by obstinate optimizations, then write code in the assembly language. The processor will unquestioningly execute all the instructions you would write.

          After all, this is not a theoretical olympiad in informatics where participants are supposed to describe the algorithm and prove its complexity. If we code in high-level programming languages, then it's essential for a compiler to speed up the code wherever it's possible.

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

            The solution is not wrong. It gives correct answers for all the tests.

            The fact that it gets AC for all test doesn't mean it's not wrong.

            But the question is: where is the margin between optimizations which influence correctness and optimizations which do not?

            Of course we can't answer this for sure, but at least loop elimination prohibiting could be a good place to start.

            I don't insist on it, I was just curious of the authors' opinion.

            Anyway, what motivated me to start this conversation was getting AC by the wrong solution, and I'll keep claiming it is wrong just because it's not completely correct (whether or not you agree with such interpretation).

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

              Once again: the solution is not wrong. It's slow. It's a slow correct solution. Not all correct solutions are supposed to fit into the time limit, as well as not all slow solutions are supposed to be rejected. Some of them may pass, though.

              at least loop elimination prohibiting could be a good place to start

              Sorry, but this is not a constructive way of discussion.

              Here is the discussion on turning on some optimization flags (-O3, -funroll-loops etc.) for G++ by default on Codeforces. You can't stop progress.

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

Has anyone done F using meet in the middle technique, instead of using normal dp. In which divide the string into 2 parts and checking each part individually ? I tried but got TLE in TC 7. Though I think it will pass if 2s is given as approx complexity is $$$O(2^{n/2}*{n/2})$$$

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

Can 131830101 be hacked? I didn't stop the while (k--) loop even after the queue (q in my code) is empty and my solution has extra $$$\log N$$$ factor because of std::set.

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

Can somebody please explain where I am going wrong in problem E?
My Submission
This code is giving wrong answer on Test 3.

My Approach:
First, I found the centroid of the tree. Then I ran a DFS from this centroid and maintained an $$$ans$$$ vector where $$$ans_i$$$ will store the number of operations after which $$$i^{th}$$$ node will be removed.
1. ans[leaf node]=1.
2. ans[node having only one child] = ans[child]+1.
3. ans[any other node] = Second_Max(ans[all children])+1.

I am taking second maximum because for a node having $$$C$$$ children, atleast $$$C-1$$$ of its children must be removed for this node to become a leaf node(removable).

Final answer will be number of nodes having $$$ans[node] \gt k$$$.

Thanks in advance.

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

Hello everyone here, Yesterday I solved 3 problems and got an accepted verdict. Today about half an hour back it still showed an accepted verdict. But now 2 out of 3 problems are showing a queue verdict. May I know the reason for this?

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

We tried to make really strong tests — just like you will be surprised if many solutions fail after the contest is over.

You intentionally gave n <= 40 in d1 where O(n) soln is easily working just to mislead participants in directly using brute force without much thinking , however if u would have given n in range 1e5 then this thing wouldn't have happened , so it is really not expected from ur side , And also in problem C , u gave time limit 4 seconds and as a result of which some O(1e9 range) solutions got accepted and now they failed system tests.

Just because of your really strong tests i got +2000 my expected place since i solved d1 before b and c so it was really disheartening to see :(

Those who are downvoting will get to know how it feels when it happens to them :)

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

Accepted.

TLE.

Just changed vector with array and now it is accepted. It feel very bad (T_T) During the contest my solution was accepted and after systest it gave TLE). First time I had got under 2000 rank. It was meant a lot for me. And now this happened because of vector vs array:|

Spoiler

PS: Do anyone know how to use vectors as fast as arrays?

PS: TLE code accepted on removing #define int long long.

PS: But, creating dynamic array example: int*m = new int[k + 1]; gives MLE. 131911303

PS: Global vector working fine.

By the way nice contest ^_^. IMO there should have such testcases during the contest so that we can correct this things during the contest.

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

Dear MrPaul_TUser and MikeMirzayanov

Testing the D2 question cases seems very inappropriate !

See my submission , it gets wrong on test 56! While it received accept in pretests. It costs me a sharp drop in rankings so from near 1500 i become 3500 because of weak testcases! So i really please you to reduce the testcases for D2 and rejudge this question.

131848968

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

Can anyone explain why my submission causes RTE, please? 131823111 Same code in Python3, I passed test

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

    Technically, in C and C++ (and most other languages I guess), any integer other than 0 is considered true, so your comparator function that you passed into the sort function to sort your input in descending order is not working as intended, I replaced return a.first - b.first; with return a.first > b.first and the code worked perfectly.

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

I can't get over this that was my best performance since I started on this site I had a break command in my previous WA submission for E and i fixed everything but deleted the break by mistake it passed and got hacked :'( I could have reached expert without that stupid break command went from 250 to 670 someone give me 10 bags of tissues :'( :'( :'(

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

When will the rating changed?

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

When will the rating changed?

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

Why do I see this contest in my unrated contest. My rating is < 1600

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

I often see it is written in the open hack or system testing phase that only trusted participants. What does this mean?

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

    Read the announcement carefully and you'll find:

    Remember that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as trusted participants of the third division, you must:
    take part in at least two rated rounds (and solve at least one problem in each of them),
    do not have a point of 1900 or higher in the rating.

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

When will the editorial be released Waiting for the explanation of D2 and E problems

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

Well, I have waited for 4 hours from the open hacking ended. However, I didn't see any signs about rating. I'm very nervous and I want to ask when will Codeforces rate? Thanks and I know a lot of people are waiting like me =))

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

i am wondering(HELP) what is the significance of n is even in D1 problem

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

.

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

Can we use meet in the middle for D2??

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

In problem C: "The actions are performed until any mouse hasn't been hidden or isn't eaten."

That should be while not until. Every programmer should know it regardless of English proficiency.

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

Congratulation @Viettran, 8528190072TuanHD

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

It's sad to see that top1 and top2 in div3 are cheaters (U need to use unofficial leaderboard to see them). They have multiple submissions to different problems within one minute using completely different templates xD MrPaul_TUser maybe something can be done about that, althought I doubit it.

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

I have given all three rounds made by you MrPaul_TUser and personally found all this rounds very interesting now I am excited and waiting for your next rounds and thanks alot for writing such nice and interesting problems:)

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

I have solved the problem E in the following way, however getting TLE #4. Here's the solution.

I'm maintaining a sorted set of pairs of vertexId and its adjacency list (in fact, set in the implementation). In each operation, removing pairs from the set where the adjacency list size is one. And also removing it from its the only neighbour. And this solution gets timelimit but I believe it shouldn't have very bad complexity.

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

    Actually the constraints of n and k both are 10^5 . But the interesting thigh which we have to notice in question is that author only given that the sum of n over all test cases will not exceed 4×10^5.So if you solve this problem in O(n) then it will be O(n) only but if you will solve this question in O(k) so actually you are solving it in O(T*k). That's why your code is getting TLE. I hope that I cleared your doubt if not then let me know I will try to elaborate it or simply it.

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

      Well, when the sorted set is empty, I break, it shouldn't go over n, even n/2 operations as in each operation there are at least 2 leaves/vertices erased. I think my solution is O(nlogn) due to the sorted set.

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

        Yes, Actually sorry I didn't read your code completely so I thought you are not breaking that for loop of k. If you will get the reason for which your code is getting TLE then please also let me know. It will be informative and helpful for me also :)

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

When will the editorial be released?

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

There is a brute force solution for D2 that passes https://mirror.codeforces.com/contest/1593/submission/131966435 . Did you intend for optimally written brute force to pass for D2 ?

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

ok

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

    Your comment was very funny, so I checked your profile out of curiosity. Useless code inserted to avoid plag checker (successfully in many contests). I didn't expect you were a cheater. What a plot twist.

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

According to here, the editorial should be posted no later than 1 day after a round. So why the editorial of this round hasn't been posted yet?

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

just my opinion nothing else:

Spoiler

thnx for the contest authors! eagerly waiting for editorials :D

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

Can anyone help me why this 131912878 fails for problem E ?

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

Editorials???

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

No Editorial till now

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

2 days and still no editorial . WTF!!!

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

I hope to be blue before the editorial is published

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

someone know why I get TLE for this java submit 132153643?

It's totally same solution with my c++ submit -> 132153310

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

Both this announcement and the editorial do not seem to be attached to the round. Thanks for the round!

Update: fixed already.

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

why rating havn't change after remove cheaters? i think it should increased a bit

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

About my code similarity with user "grafOn". That is my second account that i use for checking if my code is right and right after that I submit that code on my profile. I didn't know that was breaking the rules. I am sorry for that. I don't know how to prove to you that it is my second profile. Please tell me if i broke the rules of CF.

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

    read the Terms of agreement

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

      I read it, but there was nothing about having two accounts at the same time. I just don't understand why i can't submit the same code on two accounts during the contest. After all this two accounts are mine and there is no second person that coding and submitting the same code as mine.

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

        I just don't understand why i can't submit the same code on two accounts during the contest.

        I just don't understand why every LGM does not make 10 alt accounts and stay on top of the leaderboard themselves :)

        After all this two accounts are mine and there is no second person that coding and submitting the same code as mine

        Well you yourself are the second person. What you are doing is checking if your submission is correct so you don't get a penalty on your original and can stay on top of the leaderboard. You are registered as 2 different people in the contest.

        there was nothing about having two accounts at the same time

        Next time when you click register for a contest, try reading what the box above it says.