hmehta's blog

By hmehta, history, 5 years ago, In English

Hey All!

Topcoder SRM 776 is scheduled to start at 07:00 UTC -5, Jan 25, 2020. Registration is now open in the Web Arena or Applet and will close 5 minutes before the match begins.

Thanks misof for writing the problems and coordinating the round.

This is the third SRM of Stage 2 of TCO20 Algorithm Tournament and TCO20 Regional Events Qualification

Stage 2 TCO20 Points Leaderboard | Topcoder Java Applet | Upcoming SRMs and MMs

Some Important Links

Match Results (To access match results, rating changes, challenges, failure test cases)
Problem Archive (Top access previous problems with their categories and success rates)
Problem Writing (To access everything related to problem writing at Topcoder)
Algorithm Rankings (To access Algorithm Rankings)
Editorials (To access recent Editorials)

Good luck to everyone!

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

»
5 years ago, # |
  Vote: I like it +8 Vote: I do not like it

»
5 years ago, # |
  Vote: I like it +20 Vote: I do not like it
»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Why my approach is wrong for Div2 B?

I am finding the depth of leaf node and subtracting from N for the maximum answer. My code

Thank you!

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

    The smallest test case where your code fails is N = 6. The problem is that in the heap with 6 nodes the last layer isn't full yet, but there are already no leaves in the previous layer. Your solution thinks there are still some, and claims that you can have the value 5 in a leaf.

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

      What's up with the downvotes? Do I now have a personal army of haters for some reason, or is there something actually wrong with what I wrote?

»
5 years ago, # |
  Vote: I like it +47 Vote: I do not like it

The smallest counter-test to my 1000:

{1,2,2,3,5,6,6,7,7,8,8,9,9,10,12,13,13,14,19,20,20,21,23,24,24,25,25,26,26,27,27,28,30,31,31,32} {1,3,3,5,5,7,10,12,12,13,14,14,15,15,16,17,17,19,22,24,24,25,26,26,27,27,28,29,29,31,34,36,36,38,38,40}

»
5 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Point leaderboard seems to be not working.