求一道 hust acm解题报告:Prime's Sum Again.Prime's Sum AgainDescriptionAs is known to all,a prime number is a number which can only be divided by 1 and itself.For example:2,3 and 5 are all prime numbers but 4 and 6 are not,because 4 has anoth
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/17 11:13:14
![求一道 hust acm解题报告:Prime's Sum Again.Prime's Sum AgainDescriptionAs is known to all,a prime number is a number which can only be divided by 1 and itself.For example:2,3 and 5 are all prime numbers but 4 and 6 are not,because 4 has anoth](/uploads/image/z/13333757-5-7.jpg?t=%E6%B1%82%E4%B8%80%E9%81%93+hust+acm%E8%A7%A3%E9%A2%98%E6%8A%A5%E5%91%8A%EF%BC%9APrime%27s+Sum+Again.Prime%27s+Sum+AgainDescriptionAs+is+known+to+all%2Ca+prime+number+is+a+number+which+can+only+be+divided+by+1+and+itself.For+example%3A2%2C3+and+5+are+all+prime+numbers+but+4+and+6+are+not%2Cbecause+4+has+anoth)
求一道 hust acm解题报告:Prime's Sum Again.Prime's Sum AgainDescriptionAs is known to all,a prime number is a number which can only be divided by 1 and itself.For example:2,3 and 5 are all prime numbers but 4 and 6 are not,because 4 has anoth
求一道 hust acm解题报告:Prime's Sum Again.
Prime's Sum Again
Description
As is known to all,a prime number is a number which can only be divided by 1 and itself.For example:2,3 and 5 are all prime numbers but 4 and 6 are not,because 4 has another divisor 2,and 6 has two other divisors 2 and 3.
Then the problem is:give you two nonnegative integers L and R,you are asked to tell me the sum of all the prime numbers in the range [L,R).Range [L,R) means all the integers x that L
求一道 hust acm解题报告:Prime's Sum Again.Prime's Sum AgainDescriptionAs is known to all,a prime number is a number which can only be divided by 1 and itself.For example:2,3 and 5 are all prime numbers but 4 and 6 are not,because 4 has anoth
你可以考虑打表 打一部分 比如只记录隔上100000的质数(100000不行可以试试别的)
这样l 到r 就可以快速找到[100000a,100000b]中质数的和
然后暴力[l,100000a) (100000b,r] 的质数 再加上去