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

Автор karishma_gupta, история, 4 года назад, По-английски

https://codeforces.com/contest/448/submission/96518240 I think the complexity is O(n^2) and so, I can't figure out as to why does it TLE? I have been trying to debug it and optimize it for hours. Any help would be appreciated.

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

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

After seeing the title I thought, you are gonna help me with this problem..

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

In case of increasingly sorted input data your solution has O(2^n) time complexity.