PersonalCorpus 版 (精华区)

寄信人: sino (蚱蜢舟)
标  题: 1066
发信站: 哈工大紫丁香 (2002年03月25日21:56:27 星期一)
来  源: mtlab4.hit.edu.cn 

172078 13:59:06 25 Mar 2002
Bozhang,HIT,P.R.China 1066 Pascal Accepted 0.02 sec 53K

var
    A,B,i,n:integer;
    C1,C2,best,temp,H1:extended;
begin
    readln(n,H1);
    C1:=0; C2:=0;A:=0;B:=1;
    best:=0;
    for i:=3 to n do begin
        inc(A); inc(B);
        temp:=c2+c2-c1+2;
        c1:=c2; c2:=temp;
        temp:=(A*H1-C2)/B;
        if temp>best then best:=temp;
    end;
    writeln(-A*H1+B*best+C2:0:2);
end.

--
撷取生活中每一朵清新的浪花,智慧的浪花 ..汇成音乐的海洋.

※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: mtlab4.hit.edu.cn]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.214毫秒