This was a very difficult question for me... Now I am going back and doing it again... I wrote this mainly to develop habits !!
My idea for this question is to create an array and mark it first in the statistical method !!
1. Find out the prime factor of the President.
2. Mark the multiples of each prime factor to represent old friends.
3. Count new friend
The first step: Little coffee show can not directly search friends, only the focus of the big coffee. If you want to add we can in you and your friends to review the same video, you can see friends, and then go to the friend page, click "Attention" as shown in the following figure.
The second step: The above is a small coffee show how to add
Question Link
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1286
Questions are messy and should not be,
Started my direct brute force timeout
Timeout code
# Include Int main () {int Gy (int x, int y); int C, N, K, I; scanf ("% d", C); While (c --) {k = 0; scanf ("% d", N); for (I = 2; I # Include # Include # Include Int main (void){Int N, T, S, I, J;Int hash [40000];Scanf ("% d", T );While (t --){Memset (hash, 0, sizeof (hash ));Scanf ("% d", N );Int K = n/2;For (I = 2; I {If (N % I = 0){F
Looking for a job and advice to friends who have just learned PHP are currently looking for a job in Wuhan nbsp; find that most companies have two types: Outsourcing nbsp; use zend, cakephp and other foreign frameworks should also be familiar with foreign open source systems, a kind of domestic nbsp; almost nbsp; dedecms nbsp; ecshop nbsp; shopex and other sites nbsp; some companies even offer advice
Super small PHP pony summary (friends who are convenient to find backdoors ). Author: spider, I also come to a super small PHP pony to copy the code as follows :? Phpheader (content-Type: texthtml; charsetgb2312); if (get_magic_quotes_gpc () foreach ($ _ POSTas $ k $ v) $ _ P author: spider
I also come to a super small PHP pony.
The code is as follows:
Header ("content-Type: text/html; charset = gb23
This article describes how to quickly view the number of friends deleted by a python script. For more information, see
Preface
I believe you will have received such a group of text messages, and it is said that it is also classified as one of the five tips for fun. However, you only need to run the script, you can easily find and delete your friends.
Principle
(Hdu step 2.1.6) find new friends (simple use of the Euler's function: calculate the number of elements that are mutually compatible with n), hdu2.1.6
Question:
Find new friends
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission (s): 2788 Accept
Hdoj 1286 find new friends [Euler's function of number theory], hdoj1286
Find new friends
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission (s): 7912 Accepted Submission (s): 4157
Problem Description the New Year is approaching. The pig Association is preparing to have a
Find new friends
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)Total submission (s): 2518 accepted submission (s): 1183Problem description the New Year is approaching. The pig Association is preparing to have a party. We already know that there are n members and the number of members ranges from 1 to n. The number of the President is N, if you are an old friend of the presi
Find new friendsTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)Total Submission (s): 9387 Accepted Submission (s): 4974Problem description New Year is coming, "pig head to help the association" ready to engage in a party, already know the existing member N, the member from 1 to n number, where the president's number is N, and the president is an old friend, then the member's number affirmation and N has more than 1 of th
Topic Links:Find new friendsTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 10120 Accepted Submission (s): 5344Problem description New Year is coming, "pig head to help the association" ready to engage in a party, already know the existing member N, the member from 1 to n number, where the president's number is N, and the president is an old friend, then the member's number affirmation and N has more than 1 of the convention number, otherwise a
http://acm.hdu.edu.cn/showproblem.php?pid=1286Find new FriendsTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 8694 Accepted Submission (s): 4592Problem description New Year is coming, "pig head to help the association" ready to engage in a party, already know the existing member N, the member from 1 to n number, where the president's number is N, and the president is an old friend, then the member's number affirmation and N has more than 1 of t
Find new Friends
Problem Description The New Year is coming, "Pig Head Help Association" ready to engage in a party, already know the existing member N people, the membership from 1 to n number, where the president's number is N, and the president is an old friend, then the member's number affirmation and n have more than 1 of the convention number, otherwise are new fr
http://acm.hdu.edu.cn/showproblem.php?pid=1286Analysis: With the president's number (N) has more than 1 of the convention number is old friends, let you novelty friends number. Then the new friend must be the number of the president's number (N) coprime.Note: The general practice will time out. Euler's function is needed at this time.Euler functions:(Find the num
1702: Find new friendsTime limit: 1 Sec memory limit: MB
Submissions: 16 Resolution: 7
The status of your title: Completed
Submitted State [Discussion Version]
Title DescriptionThe new year is coming, Tian Qin ready to engage in a party, already know the existing member N, the member from 1 to n number, where the president's number is N, and the president is an old friend, then the member's number and N has more than 1 of the convention number, otherw
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.