|
|
back to boardCompilation Error! Why??? program p1218; const mx = 500; var on,tw,th,good:array[1..mx] of longint; s:array[1..mx] of string; v:array[1..mx,1..mx] of boolean; n,k,i,j:integer; c:char; function win(i,j:integer):boolean; var res:integer; begin res := byte(on[i] > on[j]) + byte(tw[i] > tw[j]) + byte(th[i] > th[j]); if res > 1 then win := True else win := False; end; function fill(j:integer):boolean; var i:integer; b:boolean; begin b := True; for i:=1 to n do b := b and v[j,i]; if b then fill := True else fill := False; end; begin readln(n); for i:=1 to n do begin read(c); s[i]:=''; repeat s[i] := s[i] + c; read(c); until c = ' '; readln(on[i],tw[i],th[i]); end; for i:=1 to n do for j:=1 to n do v[i,j] := win(i,j); for k:=1 to n do for i:=1 to n do for j:=1 to n do if not v[i,j] then v[i,j] := v[i,k] and v[k,j]; for i:=1 to n do if fill(i) then writeln(s[i]); end. Re: Compilation Error! Why??? 'on' is a reserved keyword. |
|
|