Moderator: Board moderators
shahriar_manzoor wrote:As everything is integer and maximum coordinate is small there is an all integer solution and counting sort works in that case.

Maniac wrote:Cool, I never used countsort before but now I see the valueGot AC in 0.9 sec now.
I still wonder how one might find the median of an arbitrary array in linear time though....
little joey wrote:shahriar_manzoor wrote:As everything is integer and maximum coordinate is small there is an all integer solution and counting sort works in that case.
Well, the limits for A and B are not explicitly given, so knowing you from past problems, I would expect anything (say values in the billions), in which case an all integer solution with counting sort becomes extremely infeasible.
Are you loosing your sharp edges, or did your past problems make me a little over-cautious?
little joey wrote:shahriar_manzoor wrote:As everything is integer and maximum coordinate is small there is an all integer solution and counting sort works in that case.
Well, the limits for A and B are not explicitly given, so knowing you from past problems, I would expect anything (say values in the billions), in which case an all integer solution with counting sort becomes extremely infeasible.
Are you loosing your sharp edges, or did your past problems make me a little over-cautious?
bugzpodder wrote:I have a O(n) that runs in .293, My O(nlogn) runs in .110 for quick sort built in C++.
and distances to the line with rational slope from integer points are an integer multiple of an integer to the power of -2
bugzpodder wrote:I have a O(n) that runs in .293, My O(nlogn) runs in .110 for quick sort built in C++.
and distances to the line with rational slope from integer points are an integer multiple of an integer to the power of -2

misof wrote:But I don't see this as a problem. In my point of view, also the fast O(N log N) solutions are good and should be ACed.
Users browsing this forum: No registered users and 0 guests