摘要: 用素数筛,枚举所有区间,把加和,并把ans对应的位+1.View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;#define maxn 10005bool is[maxn];int prm[maxn];int sum[maxn];int ans[maxn];int getprm(int n){ int i, j, k = 0; int s, e = (in 阅读全文
posted @ 2011-03-24 12:40 金海峰 阅读(535) 评论(0) 推荐(0) 编辑