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

Show all messages Hide all messages

WA????????????? 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????????????? 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 Oleg 7 Dec 2002 19:16
why???????????????????????
WA HELP PLEASE 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 Azrael 15 Dec 2002 22:51
Watch my previous message.
Read task.
wy 2 1000 =47?????? Oleg 17 Dec 2002 09:19
> Watch my previous message.
> Read task.
Re: wy 2 1000 =47?????? mistaken 19 Sep 2003 18:38
You are wrong!
2 1000 = 45