CHEFGM - Editorial

author and tester solutions are not provided

1 Like

you are right…duplicate values are irrelevant. Even I am surprised you got AC for the first approach. The first approach has to be wrong. Compare your answers on this test case: 1 2 5 4 4 9 11 16 2 9 10
The first one will give “even” but the second will give “odd”. And obviously the correct answer is odd.

On searching a little more, I was surprised to see that almost all the solutions on the first page are failing on this test case.

Good Point !!!

@sikander_nsit, Correct observation!

1 Like

Correct answer to this case should actually be DON’T PLAY. We have two piles {3,3,3} and {2,4}. If you take ODD then the opponent will select 2 from second pile and you will lose. If you take EVEN and chose 2 then opponent will chose 3 from first pile and you will be left with nothing.

even is correct!!! select 4 1st!!!

@mayank2k11 correct answer is even. If you take 4 your opponent takes 3 and then you take 2.

may be you are correct.
But the example provided by you… the answer is ODD.
Please try.

The answer should be “don’t play” as if the player chooses odd he will have to remove all ones and then the opponent will win by removing 2 from the other pile. If the player chooses even then he will have to remove 2 and the opponent will win by removing all ones from the other pile.

1 Like

Updated links for Author’s and Tester’s solutions

Looks like the condition that pile contains only unique numbers got missed. I can see assert in Setter’s code that numbers are unique. I will let setter comment on this.

@shaleen did you intend to say that the pile contains “only unique numbers” ?

@kcahdog, yes! I just edited my comment…

@shaleen if the test cases are wrong or if their is any missing assertion with the problem statement than it’s purely not the participant’s problem. I was thinking that i was wrong, even I created more than 400 test cases of my own, but as we all have noticed a large group of submission are giving WA on very simple test cases. All the solutions must be rejudged.

I don’t think the solutions can be rejudged now because many of the users whose solutions are failing would have been able to correct their code if their solutions were judged WA. This is the problem setter’s mistake and nothing can be done about this now. This is actually a grave issue as it seems there is one problem in every month’s contest which has some missing test cases(remember KAMEHAMEHA).

@sikander_nsit In that case,let all WA submissions must be rejudged because as you said we cannot do anything after the contest for successful submissions which I also consider ok, but by rejudging the WA solutions with Correct Test Files, will reward with a fruit of green tick for their work which they did for the rest of the contest. I consider that if you are making a jugdement on the basis of the thing that now the contest is finished,then I can also say that ‘If I had known that a Wrong submission will give me a Correct Answer I would have done the same, but Alas the contest is finished.’

The present test files are not wrong but merely missing some test cases. So any solution which got WA during the contest will still be judged WA after rejudging. Your second point is valid generally but in this particular problem, the missing test case is not such as to prevent someone from submitting because their solution would have failed on the missing case but otherwise were correct. Only adding a single statement(std::unique) to the failing solution will make them correct.

According to question “all the numbers which are greater than or equal to chosen number will be removed from that pile”. Clearly saying that the number will be removed from that pile only ! So, ODD will be correct answer !

Grundy Theorem is applicable to only impartial games. This game is partial.