哪有?此程序瞬秒。
program Quick_Sort ;
var a : array[0..1000000] of longint ;
i , n : longint ;
procedure qsort( s , t : longint ) ;
var i , j , d , x : longint ;
begin
i := s ; j := t ; x := a[s+random(t-s+1)] ;
repeat
while ( a[i] < x ) do inc( i ) ;
while ( a[j] > x ) do dec( j ) ;
if ( i <= j )
then begin
d := a[i] ; a[i] := a[j] ; a[j] := d ;
inc( i ) ; dec( j ) ;
end ;
until ( i > j ) ;
if ( s < j )
then qsort( s , j ) ;
if ( i < t )
then qsort( i , t ) ;
end ;
begin
assign( input , '1.in' ) ; reset( input ) ;
assign( output , '1.out' ) ; rewrite( output ) ;
randomize ;
readln( n ) ;
for i := 1 to n do
read( a[i] ) ;
qsort( 1 , n ) ;
for i := 1 to n do
writeln(a[i]) ;
close( input ) ;
close( output ) ;
end .