Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:Help!Help!Help!我的程序一直WA,帮忙看看啦!Thanks!In Reply To:Help!Help!Help!我的程序一直WA,帮忙看看啦!Thanks! Posted by:yanghuan at 2006-08-07 00:41:51 > Program Lx; > Type > Arr=Array[1..250] Of Longint; > Var > a: Array[1..250, 1..250] Of Longint; > b, c: Arr; > i, j: Longint; > n, p: Longint; > f: Boolean; > Begin > Readln(n, p); > For i:=1 To n Do Begin > For j:=1 To p Do Read(a[i, j]); > Readln; > End; > For i:=1 To n Do Begin > b[i] := i; > c[i] := i; > End; > For i:=1 To 1000000000 Do Begin > For j:=1 To n Do c[j] := a[c[j], (i - 1) Mod p + 1]; > f := true; > For j:=1 To n Do > If (b[j] <> c[j]) Then Begin > f:=false; > break; > end; > If (f) then Begin > Writeln(i); > Exit; > end; > End; > End. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator