标签:logs namespace cstring clu div span oid prime algo
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; void Euler_sieve(int x) { for(int i=2;i<=n;++i) { if(!vis[i]) { vis[i]=1; prime[++cnt]=i; } for(int j=1;j<=cnt&&prime[j]*i<=n;++j) { vis[i*prime[j]]=1; if(i%prime[j]) break; } } } int main() { scanf("%d",&n); Euler_sieve(n); printf("%d",cnt); return 0; }
标签:logs namespace cstring clu div span oid prime algo
原文地址:http://www.cnblogs.com/mljkw-gsry/p/7267567.html