Блог пользователя TurtleShip

Автор TurtleShip, 12 лет назад, По-английски

Hi,

I posted my solutions to all 5 problems with explanations in my blog http://sk765.blogspot.com/2012/04/croc-champ-2012-qualification-round.html

I tried to upload the content in codeforces blog, but I failed.

I wrote the editorial so that I can better understand problems I solved and possibly receive feedbacks on my approach. And it would be great if anybody could benefit from my blog.

Please feel free to give me feedbacks.

Have an awesome day :-)

  • Проголосовать: нравится
  • +18
  • Проголосовать: не нравится

»
12 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Long longs were not needed in C. The answers (barely) fit in an int. Also, in E, it is actually not needed to create the tree data structure, it suffices to think that we are traversing the tree while parsing the input (because the input is given in the order in which we would traverse the tree anyway). We only need to maintain a current stack of tags (and, for every tag, the indexes i of the solved[i] that we will need to decrement when we close that tag).

In absence of an editorial, it's very good that you wrote this post, I'm sure that some coders will find it useful :)

  • »
    »
    12 лет назад, # ^ |
      Проголосовать: нравится +4 Проголосовать: не нравится

    Thank you for your tips. Somehow I thought the max value for int was 2 * 10^9. Now I know the max value for int is 2,147,483,647, so the answer does fit into int as you said :-)

    And you are absolutely right about E. As a matter of fact, using tree structure slows down the program a bit. In other words, the approach you mentioned is faster. I used the tree structure because it was the approach I tried to use during the contest.

    Thanks for your tips. I will update my blog accordingly :-)

»
12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I have a more simple and faster solution for D (280 ms for 1 10000000)

1479055