bzoj-2190-Honor Guard-sdoi2008-Euler function

Source: Internet
Author: User

Describe

as a sports Commissioner, C June is responsible for the training of the honor guard. Guard of Honor is composed of students of N * N Square, in order to ensure that the team in the March uniform, C June will follow the guard of honor left behind, according to his line of sight and the number of students to determine whether the team is neat. Now, C-June wants you to tell him the number of students you can see when the team is neat.

Analysis

    • Analysis, if the point of C as (0, 0), then if the point (x, y) x, y coprime words, the point (x, y) must be seen.
    • The problem translates to how to find the number of all coprime that are less than N.
    • Euler functions
    • But the Euler function sieve method is less than x and x coprime number, if (x, y) can be seen, then (y, X) can also be seen. So the result should be. But (1, 1)
    • Also because C is used (0, 0), and (0, 1) and (1, 0) two points are not counted.

Code

bzoj-2190-Honor Guard-sdoi2008-Euler function

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.