求助

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 条评论

目前还没有评论...

信息

ID
1237
难度
7
分类
其他 | 二分查找 点击显示
标签
递交数
5453
已通过
1050
通过率
19%
被复制
17
上传者