Advertisement
Saleh127

Live archive 6843 / judge show CE but actually AC code

Sep 18th, 2021
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int dp[30005];
  4. bitset<900000005>v;
  5.  
  6. int main()
  7. {
  8.  
  9. int n,m,i,j,k,l=0;
  10.  
  11. for(i=0;i<=30000;i++)
  12. {
  13. for(j=0;j<=i;j++)
  14. {
  15. if(v[i*j]==0)
  16. {
  17. l++;
  18. v[i*j]=1;
  19. }
  20. }
  21. dp[i]=l;
  22. }
  23.  
  24. scanf("%d",&m);
  25. while(m--)
  26. {
  27. scanf("%d",&n);
  28. printf("%d\n",dp[n]);
  29. }
  30.  
  31. return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement