Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Is the performance of Arrays.sort quadratic here?

Правка en2, от 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


  Rev. Язык Кто Когда Δ Комментарий
en2 Английский PrakharJain 2017-05-21 00:47:27 69
en1 Английский PrakharJain 2017-05-21 00:43:58 604 Initial revision (published)