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 1191. Catch the thief!

Help! Why am I getting all those WA's???
Posted by Alex[LSD] 17 Jun 2002 22:46
It would be the best if you email pipm@mail2000.ru

Program acm_1191; {Cops And Robbers}
Var i,j,k       :integer;
    L,N         :integer;
    A           :array [1..100] of integer;

Begin
  ReadLN(L,N);
  For i:=1 to N do Read(A[i]);

  For i:=1 to N do
  Begin
    {Checking I-th stop}
    If A[i]>=l then Begin Writeln('YES'); Halt(0); End; {CAUGHT}
    j:=200*A[i]-l;
    l:=l+(j mod A[i]); {Cop waiting}
    l:=l-A[i]; {Robber waiting}
  End;
  Writeln('NO');
End.
Hint: I had soved it with 3 shortint variable.
Posted by Locomotive 17 Feb 2003 09:53