Please read the new rule regarding the restriction on the use of AI tools. ×

yogomate's blog

By yogomate, history, 21 month(s) ago, In English

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

  • Vote: I like it
  • -9
  • Vote: I do not like it

»
21 month(s) ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

https://codeforces.net/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.