摘要:
用素数筛,枚举所有区间,把加和,并把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 阅读全文