摘要:
#includeint isprime(int n){ int i; if(n==1) return 0; if(n==2) return 0; for(i=2;i*i<=n;i++) { if(n%i==0) break; } ... 阅读全文
posted @ 2015-03-13 19:43
xryz
阅读(118)
评论(0)
推荐(0)
摘要:
按照老师讲的第四种算法实现的,时间复杂度为n。 第二种方法应该会超时…… 分治下次学习之后再写。#include#include#include#include#includeusing namespace std;int main(){ int n,a[100005],i,M... 阅读全文
posted @ 2015-03-13 18:58
xryz
阅读(120)
评论(0)
推荐(0)