Please read the new rule regarding the restriction on the use of AI tools. ×

rrepeat's blog

By rrepeat, history, 8 years ago, In English

For problem 710B following solutions:

  1. AC solution using collections.sort.
  2. TLE solution using Arrays.sort.

Does this mean Arrays.sort is slow, and should not be used in contests ? Anybody encountered such problem before ?

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

| Write comment?
»
8 years ago, # |
  Vote: I like it +14 Vote: I do not like it

The worst case sort for Arrays.sort() of a primitive data type is O(n^2) i believe. Try changing your array type to Integer and use Arrays.sort(). That might give you Accepted.