1. Find the shortest path on the square
2. Use two colors to dye the six pieces in a circle. If they are obtained through rotation, they are regarded as only one. How many dyeing modes are there?
Set the two colors to black and white
All black 1 + all white 1 = 2
1 black 5 white (1 type) + 1 white 5 black (1 type) = 2 types
2 black 4 white (two black ones can be placed next to each other, two black ones are separated by one pawn, and two black ones are separated by two pawns)
4 Black 2 white with 2 black 4 white symmetric: 3
3 black 3 White: three black ones are connected together (one type). Any two of the three black ones are not adjacent (one type), and two of the three black ones are adjacent, the other piece is not adjacent to the two pieces (two types)
Four Types
In particular, the other two pieces are not adjacent to the two pieces. There are two types: symmetric calculation at first, but actually two, because this type of rotation cannot be the same.
So there are 2 + 2 + 3 + 3 + 4 = 14 types in total
Http://blog.sina.com.cn/s/blog_4aba84bd010005rc.html
Http://bbs.csdn.net/topics/390593063
Iii. time complexity of sorting.
IV,