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 1210. Kind Spirits

Why does the program get WA? Please help me!!
Posted by TaoZhang 17 Oct 2002 20:51
Here is my program:

var
 a,b:array[1..30]of longint;
 n,i,j,l,k:longint;

begin
 fillchar(a,sizeof(a),0);
 readln(n);readln(l);
 for j:=1 to l do readln(f,a[j],a[j]);
 readln;
 for i:=2 to n do
  begin
   fillchar(b,sizeof(b),maxlongint);
   readln(l);
   for j:=1 to l do
    begin
     read(l);
     while l<>0 do
      begin
       read(k);
       if a[l]+k<b[j] then b[j]:=a[l]+k;
       read(l);
      end;
     readln;
    end;
   readln;
   a:=b;
  end;
 j:=maxlongint;
 for i:=1 to 30 do if a[i]<j then j:=a[i];
 writeln(j);
end.
I got AC now.
Posted by TaoZhang 19 Oct 2002 16:49