fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. signed main() {
  5.  
  6. int N;
  7. cin>>N;
  8. if(N == 1){
  9. cout<<0;
  10. exit(0);
  11. }
  12. N--;
  13. vector<int> v;
  14. while(N){
  15. v.push_back(N%5);
  16. N/=5;
  17. }
  18. reverse(v.begin(),v.end());
  19. for(auto i: v) cout<<i*2;
  20. // your code goes here
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5280KB
stdin
2
stdout
2