Closest-pair problem/C: Difference between revisions

m
Fixed syntax highlighting.
mNo edit summary
m (Fixed syntax highlighting.)
 
Line 1:
{{collection|Closest pair problem}}
 
<langsyntaxhighlight Clang="c">#include <stdio.h>
#include <stdlib.h>
#include <values.h>
Line 137:
/* not freeing the memory, let OS deal with it. Habit. */
return 0;
}</langsyntaxhighlight>Compile and run (1000000 points, bruteforce method not shown because it takes forever):<langpre>
% gcc -Wall -lm -O2 test.c
% time ./a.out
min: 5.6321e-05; point (19.657247,79.900855) and (19.657303,79.900862)
./a.out 7.16s user 0.08s system 96% cpu 7.480 total
</langpre>
9,476

edits