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 1131. Copying

Why got WA?!
Posted by bingo2002 23 Apr 2002 03:40
var
  d: longint;
  N,K: longint;
  time: longint;
  rest: longint;
  //flag: boolean;
begin
  { TODO -oUser -cConsole Main : Insert code here }
  readln(N,K);
  time:=0;
  d:=1;
  while d<=K do
   begin
     inc(time);
     d:=d+d;
   end;
  rest:= N-d;
  time:=time+((rest+k-1) Div k);
  writeln(time);
  //readln;
end.
Re: Why got WA?!
Posted by Yuri 3 May 2006 19:02
Try this:
1 15
The correct answer should be 0 and answer of your programm is 4.
Good luck :)
Re: Why got WA?!
Posted by Ilya (Vologda SPU) 30 Oct 2009 22:45


Edited by author 03.11.2009 22:00