|
|
back to boardWhy I got WA!!?? Can someone help me? Posted by Li Xun 7 Apr 2003 05:31 MyProgram: const max=30000; var a,b:array[1..max] of integer; i,n,x,y:longint; begin for i:=1 to max do a[i]:=max+1; readln(n); for i:=1 to n do begin readln(x,y); if y<a[x] then a[x]:=y end; b[max]:=0; for i:=max-1 downto 1 do if a[i]+1>max then b[i]:=b[i+1] else b[i]:=b[a[i]+1]+1; writeln(b[1]) end. |
|
|