Problem 1114D (Flood Fill) — Incorrect Jury's Solution

Revision en3, by TheLethalCode, 2020-06-13 12:01:43

So, while solving random problems from the problemset I came across the problem 1114D - Игра-заливка. After wracking my brain for so long I couldn't come up with any solution within the given constraints.

But when I looked at all the submissions, almost everyone approached it in the same incorrect way. It is wrong, as I have a counter test cases for these solutions, which are almost the same as the editorial.

For example, let's take the editorial submission — 49738289 . For the test case

5
1 2 1 3 1

Actual Answer

It's obvious the answer is 2. Change the 2nd and 4th cell into 1, and bingo you have the same color everywhere in 2 moves.

Program's Output

If you run it locally and check, you will find it outputting 3. This, I believe , is also the Jury's Solution,

Actual Solution

I believe the actual solution is a DP which runs in cubic time, somewhat similar to the problem 1132F - Удали строку. But given the constraints, unless the test cases are weak, I highly doubt a cubic solution can pass. So the constraints as well as the Jury's solution needs to be changed.

Edit:- I misunderstood the problem statement. The solution is correct.

Tags jury system, #wrongverdict

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English TheLethalCode 2020-06-13 12:25:53 174
en3 English TheLethalCode 2020-06-13 12:01:43 207
en2 English TheLethalCode 2020-06-13 10:14:58 3 (published)
en1 English TheLethalCode 2020-06-13 10:13:27 1337 Initial revision (saved to drafts)