| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1287447 | Johan | Rack (eJOI19_rack) | C++20 | 1 ms | 644 KiB |
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define endl "\n"
void solve(){
int n;
cin>>n;
int x;
cin>>x;
int pov=1LL<<(n-1);
if(x<=pov){
if(x%2==1){
cout<<x;
}
else{
cout<<x+pov-1;
}
}
else{
if(x%2==0){
cout<<x;
}
else{
cout<<x-pov+1;
}
}
}
signed main(){
int t=1;//cin>>t;
while(t--){
solve();
cout<<endl;
}
}//| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
