Java array (TLE) vs ArrayList(Accepted) why?

Правка en1, от VipinSharma01, 2021-01-15 14:36:31

I have seen sometimes when I sort array it gives TLE but when I sort ArrayList code gets accepted why so?? I have added 2 codes in the first one I have used array, got TLE and in the second one i use arraylist and it got accepted.

(I googled but did not found the reason)

TLE when I used array: https://codeforces.me/contest/600/submission/104404543 Accepted when I use ArrayList: https://codeforces.me/contest/600/submission/104404966

Thanks.

Теги secondthread, #java, #array, arraylist

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский VipinSharma01 2021-01-15 14:36:31 501 Initial revision (published)