Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vi prime,chk(1000009);
- void seive(){
- chk[0]=1;
- chk[1]=1;
- prime.pb(0);
- for(int i=2;i<=1000000;i++){
- if(chk[i]==1)
- continue;
- prime.pb(i);
- for(int j=2;i*j<=1000000;j++){
- chk[i*j]=1;
- }
- }
- int sz=prime.size();
- loop(i,1,100){
- cspf(i);
- pfi(prime[i]);
- line;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement