jakaria_hossain

UVA 11752 - The Super Powers

Sep 30th, 2018
108
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define fast()(ios_base::sync_with_stdio(false),cin.tie(NULL));
  4. typedef unsigned long long ull;
  5. #define pb push_back
  6. vector<ull>v;
  7. int prime[]={2,3,5,7,11};
  8.  
  9. int main()
  10. {
  11. fast();
  12. v.pb(1);
  13. for(ull i=2;i<=65535;i++)
  14. {
  15. double lm=(double)64.0/(double)log2((double)i);
  16. for(int j=0;j<5;j++)
  17. {
  18. ull k=prime[j]+prime[j];
  19. if(k>=lm)break;
  20. ull last=1,hs;
  21. for(int t=0;t<prime[j];t++)last*=i;
  22. hs=last;
  23. do
  24. {
  25. last*=hs;
  26. v.pb(last);
  27. k+=prime[j];
  28. }while(k<lm);
  29. }
  30. }
  31. cout<<"1"<<endl;
  32. sort(v.begin(),v.end());
  33. for(ull i=1;i<v.size();i++)
  34. {
  35. if(v[i]!=v[i-1])cout<<v[i]<<endl;
  36. }
  37. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×