2014-8-17 note

Source: Internet
Author: User

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,

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.