- 隐形的翅膀
- 2008-12-27 17:40:31 @
const
ll=0.6180339887498949;
var
ans,pp,min,max:real;
pi,pj,n,i,j:longint;
a:array[1..30000] of longint;
procedure ff(x,y:longint);
var i,j,l,temp:longint;
begin
i:=x; j:=y; l:=a[(x+y)div 2];
repeat
while a[i]l do dec(j);
if i=j;
if ix then ff(x,j);
end;
begin
readln(n);
for i:=1 to n do
read(a[i]); readln;
ff(1,n);
min:=-maxint; max:=maxint; ans:=maxint;
for i:=1 to n-1 do
if a[i]0 then
begin
for j:=i+1 to n do
if a[j]0 then
begin
pp:=a[i]/a[j]-ll;
if (ppmax)
then break;
if (ppmin)
then min:=pp
else if (pp>0)and(pp
0 条评论
目前还没有评论...