dino_merlin's blog

By dino_merlin, history, 9 months ago, In English

The second task from day 1 of CEOI 2016 is a task with a solution that confuses me, not because it is hard to understand, but because of the fact that I cannot understand how someone could come up with it. When I read the official solution, it just looks like they shuffled some formulas around until they got an expression with an invariant with no real motivation for the process. Is there any, more intuitive approach for solving this problem? Thanks in advance.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by dino_merlin (previous revision, new revision, compare).

»
9 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Yes, there is a more intuitive solution. It uses a technique sometimes called "Connected Component DP". There is also comment under this blog explaining how to apply it to Kangaroo.

»
5 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I also had trouble understanding the solution so I searched on the internet and somehow found someone saying that the official solution was wrong.
I think the author of this problem failed to write down the idea in full in a way that we can understand.
And all implementations I can find are "connected component DP" solutions, which are completely different from the official solution.