## Search found 3 matches

Tue May 01, 2007 12:24 am
Forum: Volume 102 (10200-10299)
Topic: 10245 - The Closest Pair Problem
Replies: 92
Views: 10547
how to compare all pairs faster than O(n^2) it gives TLE of course My algo is here. 1) Sort data in ascending order based on x coordinates. 2) Set default minimum distance d(d is distance between point1 and point2. 3) Restrict the x-range with d. 4) Copy 1) between x-range of 3). 5) --Sort 4) in as...
Tue Apr 24, 2007 6:42 am
Forum: Volume 103 (10300-10399)
Topic: 10310 - Dog and Gopher
Replies: 47
Views: 17355

### Re: math is always important...

People, perhaps this may be the most useful tip on getting your 10310 program to AC. First of all, you can use doubles (no need to use long long and multiply input by 1000 blahblah). Secondly, when the dog & gopher reach the hole at same time, it's still considered a successful escape. Lastly, and ...
Tue Apr 17, 2007 9:54 am
Forum: Volume 101 (10100-10199)
Topic: 10161 - Ant on a Chessboard
Replies: 10
Views: 5280

### are you sure it's O(1)?

You telling me you can find nearest F(N) = N^2 with O(1)?

Hmmm, I'm not sure the exact worst time is but i think it's greater than O(1), since it's from zero to the next F(N).

please point out my mistake if i'm wrong about the run time or there's better solution.

ZW