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>
#define int long long
using namespace std;
int32_t main(){
int n,k;
cin>>n>>k;
int z=pow(2,n);
map<int,int> mp;
bool first=true;
int cift=0;
for(int i=1; i<=z; i+=2){
if(i<=z/2){
mp[i]=i;
mp[i+1]=z/2+i;
}else{
if(first){
cift=2;
first=false;
}
mp[i]=cift;
mp[i+1]=z/2+cift;
cift+=2;
}
}
cout<<mp[k]%1000000007<<"\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |