|
|
back to boardTime limit exceeded var a: array[1..1000, 1..10001] of integer; c, d, e: integer; label 1; begin randomize; d := 1; Readln(c); for e := 1 to c do read(a[e, 10001]) {a[e,1002]:=random(c-1)+1}; for e := 1 to c do a[e, 1] := e; 1: inc(d); //for e:= 1 to c do write (a[e,1001],' '); for e := 1 to c do a[a[e, 10001], d] := a[e, d - 1]; for e := 1 to c do if a[e, d] <> a[e, 1] then goto 1; writeln(d - 1); end. |
|
|