vitux's blog

By vitux, history, 9 years ago, translation, In English

I was upsolving problem 573C - Bear and Drawing.

My solution 12772765 got wa12.

But after I shuffled nodes it got AC.

12772768

Difference is only in line random_shuffle(q.begin(), q.end());

After that I fixed a bug, and solved it honestly 12773232. But imho tests are a little bit weak.

  • Vote: I like it
  • +22
  • Vote: I do not like it

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

Can you explain your approach ?

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Here is a drawing with all cases. I used a similar approach 12760713.

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Yes, that's true. If you know types of all son vertices, you can get the type of father vertice.