PersonalCorpus 版 (精华区)

154549 06:27:41 5 Mar 2002
Bozhang,HIT,P.R.China 1131 Pascal Accepted 0.02 sec 49K


var
    i,n,k,sum:integer;
begin
    readln(n,k);
    sum:=0; i:=1; dec(n);
    while n>0 do begin
        n:=n-i;
        inc(sum);
        i:=i+i;
        if i>k then begin inc(sum,(n+k-1) div k); break end;
    end;
    writeln(sum);
end.
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:5.480毫秒