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 1138. Integer Percentage

What's the hell wrong with this code???Many Thanks,Thanks,Thanks!!!!
Posted by coldplayfans 3 Oct 2008 18:32
Program ex;
Const
  Infile = 'ural1138.in';
  Outfile = 'ural1138.out';
Var
  n, m, i, j, Max, Max1, Ans: Integer;
  Temp: Real;
  Data: Array [1..10000] Of Integer;
Begin
  ReadLn(n, m);
  If (n < m) Then Begin
    WriteLn(0);
    Halt;
  End;
  Data[m] := 1;
  Ans := -1;
  For i:=m+1 To n Do Begin
    Max := -1;
    For j:=m To i-1 Do Begin
      Temp := Frac((i * 100) / j - 100);
      If (Temp = 0) Then Begin
        Max1 := Data[j] + 1;
        If (Max1 > Max) Then Max := Max1;
      End;
    End;
    Data[i] := Max;
    If (Data[i] > Ans) Then Ans := Data[i];
  End;
  WriteLn(Ans);
End.