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

Автор Mastermind222, история, 6 лет назад, По-английски

Problem C

My Accepted Solution

According to me, the time complexity of the above code is O(sum*n*n)(sum= sum of the array passed to the function) and hence should result in a TLE verdict(Correct me if I am wrong).Help me in clearing this doubt. Thanks in advance. :)

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I think the time complexity is maxSum*n which would be 2000*100*100 =2*10^7 which will pass in the given time constraints.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

Try this test

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

Yes it should TLE. Weak test cases.A lot of people have done the same.