Advertisement
a53

b2

a53
Nov 13th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <fstream>
  2. #define ULL unsigned long long int
  3. using namespace std;
  4. ifstream f("b2.in");
  5. ofstream g("b2.out");
  6. ULL n,nr;
  7.  
  8. int main()
  9. {
  10. f>>n;
  11. bool ok=false;
  12. for(int x=1;x<=62;++x)
  13. {
  14. for(int y=0;y<x;++y)
  15. {
  16. nr=(1ULL<<x)+(1ULL<<y);
  17. if(nr<=n)
  18. g<<(1LL<<y)+(1LL<<x)<<' ';
  19. else
  20. {
  21. ok=true;
  22. break;
  23. }
  24. }
  25. if(ok)
  26. break;
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement