第九个点神奇挖掉,错的前所未有

P1347 排序

同求解答 ```pascal var n,m,i,j,k,x,y,l,c,sum,flag:longint; f:array[0..55,0..55] of longint; a:array[0..55] of char; xx,yy,fh:char; begin readln(n,m); for l:=1 to m do begin read(xx); x:=ord(xx)-64; read(fh); readln(yy); y:=ord(yy)-64; f[x,y]:=1; for k:=1 to n do for i:=1 to n do for j:=1 to n do if ((f[i,k]=1) and (f[k,j]=1)) then f[i,j]:=1; for i:=1 to n do if f[i,i]=1 then begin writeln('Inconsistency found after ',l,' relations.'); halt; end; for k:=1 to n do begin sum:=0; c:=0; flag:=0; for i:=1 to n do begin sum:=0; for j:=1 to n do if f[i,j]=1 then inc(sum); if sum=n-k then c:=i; end; if c=0 then begin flag:=1; break; end; a[k]:=chr(c+64); end; if (flag=1)and(l=m) then break; if flag=1 then continue; writeln('Sorted sequence determined after ',l,' relations: '); for i:=1 to n do write(a[i]); write('.'); halt; end; writeln('Sorted sequence cannot be determined.'); end. ```
by 陈臭臭。 @ 2018-07-02 17:43:33


@[陈臭臭](/space/show?uid=28799) 你#9输出了2行。。。
by yuzhiboyy @ 2018-10-04 15:36:48


@[yuzhiboyy](/space/show?uid=22424) 啊我早就过啦、
by 陈臭臭。 @ 2018-10-05 08:05:30


@[陈臭臭](/space/show?uid=28799) 我老早看到你过了
by yuzhiboyy @ 2018-10-05 09:56:48


|