|
|
back to boardWA????????????? Posted by Oleg 2 Dec 2002 14:44 var i,j,k,n,m:longint; begin while true do begin read(n); if n =0 then halt(0); read(m); if n=1 then k:=1 else k:=0; while n<>1 do begin dec(n); m:=(m div 2) + (m mod 2); inc(k); end; m:=m-1+k; writeln(m); end; end. Re: WA????????????? Posted by Azrael 7 Dec 2002 01:35 Because answer at 2 1000 is not 500:)) It's about 47 (can't remember exectly) can`t remember exectly Posted by Oleg 7 Dec 2002 19:16 why??????????????????????? WA HELP PLEASE Posted by Oleg 15 Dec 2002 09:22 var i,j,k,n,m:longint; begin while true do begin read(n); if n =0 then halt(0); read(m); if n=1 then k:=1 else k:=0; while n<>1 do begin dec(n); m:=(m div 2) + (m mod 2); inc(k); end; m:=m-1+k; writeln(m); end; end. Re: WA HELP PLEASE Posted by Azrael 15 Dec 2002 22:51 Watch my previous message. Read task. wy 2 1000 =47?????? Posted by Oleg 17 Dec 2002 09:19 > Watch my previous message. > Read task. Re: wy 2 1000 =47?????? You are wrong! 2 1000 = 45 |
|
|