I see now, the reason is in Arrays.sort(c); - when primitive types are used, quicksort is used, when Objects (like Integer) merge sort is used.
Codeforces, unfortunatelly, has anti quicksort inputs, I really hate this… If you want try to shuffle before sorting and you will see, but there is not easy (one liner) way how to do that in Java
When you use integer merge sort is used, while using int quick sort is used so an anti-quick sort input would lead to TLE. http://codeforces.ru/blog/entry/2298