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
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 isOhh nice!! Thanks a lot for telling this. I never thought we can retreive a test case like this. :)
I did not know that there is a problem named after my handle :)