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

Автор TechNite, 4 года назад, По-английски

I was getting WA on testcase 2 for the mastermind problem(DIV2E/DIV1C) in codeforces round 658. Here is my submission 87685109. The basic idea is that for perfect matching i choose thethe color with maximum frequency at each step. And after that i swap the two most frequent colors in n-x indices taking care of the odd case.(In odd case i do right cyclic shift for 3 most frequent colors)

Can anyone help me why i am getting wrong answer for this

Thanks

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

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

The test is small, so you can fully retrieve it. Just change the program to not print anything but the test case 135 in the second test. I changed your code here (look at the start of solve function) and the test that breaks your code is

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

    Ohh nice!! Thanks a lot for telling this. I never thought we can retreive a test case like this. :)

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

I did not know that there is a problem named after my handle :)