j1gsaw's blog

By j1gsaw, 12 years ago, In English

I don't understand why my code is giving TLE for this question when my complexity is O(nlogn).. Please somebody look at my code and find the bug.

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

»
12 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

It's possible you ran into an "anti-quicksort" test, since Arrays.sort on primitive types in Java 7 has worst case O(n^2) and on others is an O(n log n) mergesort. Unfair I know, but I don't see anything else that could justify so many people failing on test 46.