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 wa?only 16 lines.help me!
Posted by Failed Peter 13 Jul 2003 14:27
[code deleted]

Edited by moderator 24.11.2019 12:59
A hint.
Posted by Crazy Lemming 13 Jul 2003 21:36
> [code deleted]

You've made a little mistake. To correct this mistake you only need
to embrace some part of your program in {}.

Edited by moderator 24.11.2019 13:00
Got it,thanks.
Posted by Failed Peter 17 Sep 2003 14:47
Mine is also 16 lines(Pascal)
Posted by sqybi 14 Jan 2006 17:22
Mine is also 16 lines, but i have a Time Limit Exceeded.
Program Copying_1131;
Var
  n, k, s, a, t: Longint;
Begin
  ReadLn(n, k);
  s := 1;
  a := 1;
  t := 0;
  While s < n Do Begin
    Inc(s, a);
    If s > k Then a := k
             Else a := s;
    Inc(t);
  End;
  Write(t);
End.