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

I get Compile Error
Posted by meoden 21 Apr 2002 21:55
Help!!! This code get Compile Error. Why???

{$r+,n+,q+,b-}
var n,k,s,t:longint;
begin
   read(n,k);
   s:=1; t:=0;
   for t:=1 to 31 do
   begin
      s:=s*2;
      if s>n then break;
      if s>k then
      begin
         t:=t+(n-s+k-1) div k;
         break;
      end;
   end;
   writeln(t);
end.
Help, please!!!
Posted by meoden 23 Apr 2002 18:53
Re: Help, please!!!
Posted by LiangHonghao 27 Apr 2002 18:33
The online judge use dephi or something like dephi instead of pascal.
In this system.
if you use i in such condition.
You'll get a CE.

for example.

for i:=1 to 10 do
  begin
    i:=i;
  end;
it means that you can't change i in the repetition.
Good luck.
By the way.
your program get a WA after i use while...do instead of FOR
Thanks.
Posted by meoden 9 May 2002 20:25
> The online judge use dephi or something like dephi instead of
pascal.
> In this system.
> if you use i in such condition.
> You'll get a CE.
>
> for example.
>
> for i:=1 to 10 do
>   begin
>     i:=i;
>   end;
> it means that you can't change i in the repetition.
> Good luck.
> By the way.
> your program get a WA after i use while...do instead of FOR