This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
unsigned long long k;
cin >> k;
unsigned long long ans=0;
for(int i=0;i<n;i++){
if((k&1)==0){
k=k/2;
ans = ans << 1;
ans++;
}
else{
k=k/2+1;
ans = ans << 1;
}
}
cout << ans+1 << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |