Advertisement
erfanul007

Untitled

Jan 19th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1.  
  2. vi prime,chk(1000009);
  3.  
  4. void seive(){
  5. chk[0]=1;
  6. chk[1]=1;
  7. prime.pb(0);
  8. for(int i=2;i<=1000000;i++){
  9. if(chk[i]==1)
  10. continue;
  11. prime.pb(i);
  12. for(int j=2;i*j<=1000000;j++){
  13. chk[i*j]=1;
  14. }
  15. }
  16. int sz=prime.size();
  17. loop(i,1,100){
  18. cspf(i);
  19. pfi(prime[i]);
  20. line;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement