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

Автор yogomate, история, 23 месяца назад, По-английски

hi i am sloving this problem problem and i wrote this solution for it solution i dont know what did i do wrong but its been too long and i am not able to figure it out please help me. also please help me on my last blog to that question is also difficult

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

»
23 месяца назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

https://codeforces.me/contest/1345/submission/187186494 The general idea here is to simulate what is happening. You don’t actually need to check the heights of all h 1-10^9 but rather check all the heights that use less than or equal to 10^9 cards to create. Then you can binary search for the value or use a floor function for a given data structure to subtract the largest height you can build given the cards you have and repeat until your stack becomes less than 2. The key here is the height is not important, but rather how many cards necessary to build the height.