SGU 294 He ' s Circles

Source: Internet
Author: User

Test instructions: A necklace has n beads and each bead is black or white. How many different kinds of necklaces are there?

Note that the number of n is very large, therefore, we enumerate I (1<=i<=n), so that l=n/i, to find the Euler function of L, then these numbers and L coprime, so gcd (k,n) =i k A total of L Euler functions, this is a very clever way of conversion, and this problem requires high precision. The final answer is the Euler function of σ (2^i*k)/n,k (n/i).

Code: Too long dare not fight, afraid to change a day can not be changed out.

SGU 294 He ' s Circles

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.