Is the performance of Arrays.sort quadratic here?

Revision en2, by PrakharJain, 2017-05-21 00:47:27

In the problem Div 2 C of the recent Codeforces round #415, I got TLE on test 69. I was unable to figure out the reason as the loop was running for just n times. So, I changed my array to arraylist, and used Collections.sort() instead of the Arrays.sort(). To my surprise, it passed without any other changes! What could be the reason here? Check my last 2 submissions for this : TLE Submission and Accepted submission

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English PrakharJain 2017-05-21 00:47:27 69
en1 English PrakharJain 2017-05-21 00:43:58 604 Initial revision (published)