### karthiksing05's blog

By karthiksing05, history, 2 months ago,

hey guys! so i was working on this problem Stick Division on CSES on the USACO Guide. Eventually I got the right answer, but one of my first submissions was this LINK, which I thought ran in O(N^2) time: was very surprised to see that it ran through without being timed out seeing as N was a maximum of 10^5 (ofc 2 out of the 6 test cases passed anyways so still problematic). To summarize: my question is, what's the time complexity of this and if it's higher than O(NlogN), why did it run this way?

• -2

 » 2 months ago, # |   +2 Link doesn't work for me :((
 » 2 months ago, # | ← Rev. 2 →   +5 Guy you'd better delete the extra close parenthese to save your link.Like this:[LINK](https://pastebin.com/KpAgqLUN) will be LINK
•  » » 2 months ago, # ^ |   0 Sorry for the confusion. Yeah, the link doesn’t include that parenthesis.