Mastermind222's blog

By Mastermind222, history, 5 years ago, In English

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. :)

  • Vote: I like it
  • +24
  • Vote: I do not like it

| Write comment?
»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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.

»
5 years ago, hide # |
 
Vote: I like it +18 Vote: I do not like it

Try this test

Spoiler
»
5 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

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