Mastermind222's blog

By Mastermind222, history, 4 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. :)

Full text and comments »

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

By Mastermind222, history, 4 years ago, In English

This is in regard with Codeforces Round #660-Div 2 Problem B. I submitted a solution to this problem in O(n) time complexity. It passed all the pretests but gave TLE in system testing but later during practice the same code was accepted.

Solution submitted during contest: https://mirror.codeforces.com/contest/1388/submission/88486803 gave TLE.

Solution submitted for practice: https://mirror.codeforces.com/contest/1388/submission/88530257 passed all the test cases.

Can anyone explain me why it happened? Thanks in advance!

Full text and comments »

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