就是找素数。很水的题。模糊搜索一道题搜到的。
但是却 TLE 2次。把所有的 long long 改成 int ,%lld 改成 %d 就神奇的过了。
简直不可思议。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#def...
                            
                            
                                分类:
其他好文   时间:
2014-11-13 18:55:12   
                                阅读次数:
176
                             
                    
                        
                            
                            
                                Ice_cream’s world III
Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 926    Accepted Submission(s): 303
Problem Description
ice_cr...
                            
                            
                                分类:
编程语言   时间:
2014-11-13 16:37:46   
                                阅读次数:
260
                             
                    
                        
                            
                            
                                Prime PathDescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to chang...
                            
                            
                                分类:
其他好文   时间:
2014-11-13 14:26:51   
                                阅读次数:
200
                             
                    
                        
                            
                            
                                反正知道了就是知道,不知道也想不到,很快#include #include #include using namespace std;inline void print_prime_k(long long p, long long k) { printf("%lld", p); ...
                            
                            
                                分类:
其他好文   时间:
2014-11-12 20:59:25   
                                阅读次数:
211
                             
                    
                        
                            
                            
                                Prime Distance
Time Limit: 1000MS
 
Memory Limit: 65536K
Total Submissions: 12811
 
Accepted: 3420
Description
The branch of mathematics called number theory is about p...
                            
                            
                                分类:
其他好文   时间:
2014-11-12 13:51:21   
                                阅读次数:
248
                             
                    
                        
                            
                            
                                还是畅通projectTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26860Accepted Submission(s): 11985Probl...
                            
                            
                                分类:
编程语言   时间:
2014-11-12 13:36:00   
                                阅读次数:
272
                             
                    
                        
                            
                            
                                Problem DescriptionYou just need to calculate the sum of the formula: 1^2+3^2+5^2+……+ n ^2.InputIn each case, there is an odd positive integer n.Outpu...
                            
                            
                                分类:
其他好文   时间:
2014-11-10 23:09:21   
                                阅读次数:
271
                             
                    
                        
                            
                            
                                【题意简述】:题意很简单,就是用连续的素数加和,计算有多少个这样的连续的素数数列可以使这个序列的和等于输入的数。
【分析】:很经典的素数模板,基本所有有关素数的题,我都会使用这个模板。
// 268K 16Ms
#include
using namespace std;
#define N 10000
bool isprime[N];    
long long prime[1300],np...
                            
                            
                                分类:
其他好文   时间:
2014-11-10 21:50:41   
                                阅读次数:
264
                             
                    
                        
                            
                            
                                从1到s选出k个数 他们的最大公约数大于1 求方案数
容斥 S(1)-S(2)+S(3) S(x)为选出k个数的公因子个数为x的数量
#include 
#include 
#include 
using namespace std;
typedef long long LL;
const int maxn = 55;
int prime[maxn], vis[maxn];
int n, m;...
                            
                            
                                分类:
其他好文   时间:
2014-11-07 11:21:15   
                                阅读次数:
146
                             
                    
                        
                            
                            
                                C++ Primer第五版这本书是久负盛名的C++经典教程,本篇博文为C++Primer(第五版)中文版第九章课后编程习题解答。...
                            
                            
                                分类:
编程语言   时间:
2014-11-07 09:57:06   
                                阅读次数:
267