Professional Documents
Culture Documents
However, once
Turn 0 a1
Turn 90
a2 =
Turn 180
a3 =
Turn 270
a4 =
Permutation group: Elements of permutation groups is replaced, the
replacement operation is connected. E.g:
90,turn180,turn270}
We look at a formula:│Ek│ · │Zk│ = │G│ k = 1 ... n
The formula is a very important object of study is the number of elements
of the group, is very useful.
Zk (K fixed displacement class):Let G 1 ... n of the permutation group.
If K is an element in 1 ... n, G K remains constant manipulation of the
entire substitution, referred to Zk, manipulation is called G K remains
immobile substitution class, substitution classes referred K does not
move.
As in this
\ Sij \ j
elements
aI
among them
same color of the resulting image data MC (gi) corresponds exactly to the
Upper right corner i, less than the other two integers i, a total of i2.
The upper right corner, lower right corner i, is not greater than the
lower left corner of i, i + 1 th common.
Lower right corner i, less than the other two integers i, and the
number is not less than the lower left corner to the upper right corner,
co i (i + 1) / 2 th.
therefore,
result.
[Program] problem solution
const
maxn = 10;
var
a, b: array [1..maxn, 1..maxn] of integer; {record} square state
i, j, m, n: integer; {m number of colors; n-matrix size}
l, l1: longint;
procedure xz; {90 the rotation matrix}
var
i, j: integer;
begin
for i: = 1 to n do
for j: = 1 to n do
a [j, n + 1-i]: = b [i, j];
b: = a
end;
procedure xhj; {number of cycles of the current state calculating section}
var
i, j, i1, j1, k, p: integer;
begin
k: = 0; {section used to record the number of cycles, cleared}
for i: = 1 to n do
for j: = 1 to n do
if a [i, j]> 0 then {not currently visited search grid}
begin
inc (k); {1} plus the number of loop section
i1: = (a [i, j] -1) div n;
j1: = (a [i, j] -1) mod n + 1; {get the next cycle lattice}
a [i, j]: = 0; {} indicates that the cell has been visited
while a [i1, j1]> 0 do begin
p: = a [i1, j1]; {} temporary grid current information
a [i1, j1]: = 0; {set} visited flag
i1: = (p-1) div n + 1;
j1: = (p-1) mod n + 1 {get the next cycle of the grid}
end {exit until after complete access over this cycle}
end;
l1: = 1;
for i: = 1 to k do l1: = l1 * m; {calc} k-th power of the m
l: = l + l1 {} is accumulated
end;
begin
writeln ( 'Input m, n =');
readln (m, n); {} input data
for i: = 1 to n do
for j: = 1 to n do a [i, j]: = (i-1) * n + j; {square initialized state}
b: = a;
xhj; {0 revolutions calculatedNumber of cycles of the section in a
state}
xz; {90 rpm}
exactly.
After some analysis above, making a seemingly intractable problem
is clever solution, and the rest just do a bit of precision can be calculated.
By these few examples, we must Pólya principle of understanding
with 89 percent, and search method by contrast, it becomes clear
superiority. It not only greatly improve the time efficiency of the
program, even in the difficulty of programming is also on the decrease.
Therefore, we at the same time growing intelligence and experience, we
can not ignore the principle of knowledge. Intelligence and experience is
important, but even more to grasp the principles of ease. Therefore, we
are more than solving it, but also did not forget to learn the principles of
knowledge, non-stop to recharge, so that their level greater leap.