Created
August 4, 2017 04:45
-
-
Save thhmoc67/04e2e509d5dea8b73fbe710564daa31e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include<cmath> | |
| using namespace std; | |
| unsigned long long ffnum(unsigned long long x){ | |
| long long p=1; | |
| unsigned long long sol=0; | |
| while(x){ | |
| if(x&1){ | |
| sol+=p; | |
| } | |
| p*=7; | |
| x>>=1; | |
| } | |
| return sol; | |
| } | |
| int main() { | |
| int t; | |
| cin>>t; | |
| while(t--){ | |
| unsigned long long x; | |
| cin>>x; | |
| unsigned long long ans=ffnum(x); | |
| cout<<ans<<endl; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment