http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1756 直接暴力O(n^2logn)过不了 两两算gcd 考虑每个数的范围[1,1000]统计一下即可O(1000^2*log(1000)) Notice:1与任何数互质,需要特判(自己与自己互质) Code1 统计 // <1756.cpp> - Wed Oct 19 08:25:53 2016 // This file is made by YJinpeng,created by XuYik…
Description xrdog has a number set. There are 95 numbers in this set. They all have something in common and are all positive integers less than 500. The naughty xiao zhuan has deleted one of the numbers in the set. Can you find the number that xiao z…
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1552 Description On an alien planet, every extraterrestrial is born with a number. If the sum of two numbers is a prime number, then two extraterrestrials can be friends. But every extraterrestr…
Description: Count the number of prime numbers less than a non-negative number, n click to show more hints. Credits:Special thanks to @mithmatt for adding this problem and creating all test cases. 求n以内的所有素数,以前看过的一道题目,通过将所有非素数标记出来,再找出素数,代码如下: public i…
Peter wants to generate some prime numbers for his cryptosystem. Help him! Your task is to generate all prime numbers between two given numbers! Input The input begins with the number t of test cases in a single line (t<=10). In each of the next t li…
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 Accepted: 10989 Description Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representatio…