Codeforces 55A Flea travel solution

Solve in C++:
  1. ///**********ALLAH IS ALMIGHTY************///
  2. ///AH Tonmoy
  3. ///Department of CSE
  4. ///Islamic University,Bangladesh
  5. #include<bits/stdc++.h>
  6. using namespace std;
  7. int main()
  8. {
  9. long long n;
  10. cin>>n;
  11. while(n%2==0)
  12. {
  13. n=n/2;
  14. }
  15. if(n==1)
  16. cout<<"YES"<<endl;
  17. else
  18. cout<<"NO"<<endl;
  19. }

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.