ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1223. Chernobyl’ Eagle on a Roof

WA?????????????
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??????
Posted by mistaken 19 Sep 2003 18:38
You are wrong!
2 1000 = 45