제출 #1287446

#제출 시각아이디문제언어결과실행 시간메모리
1287446JohanRack (eJOI19_rack)C++20
0 / 100
1 ms572 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define endl "\n" const int INF=1e18; #define no "NO" #define yes "YES" #define pb push_back 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; } } } /** *(1 2) * 1 17 1 2 * 3 19 3 4 * 5 21 5 6 * 7 23 7 8 * 9 25 9 10 * 11 27 11 12 * 13 29 13 14 * 15 31 15 16 * * * 2 18 17 18 * 4 20 19 20 * 6 22 21 22 * 8 24 23 24 * 10 26 25 26 * 12 28 27 28 * 14 30 29 30 * 16 32 31 32 */ signed main(){ int t=1;//cin>>t; while(t--){ solve(); cout<<endl; } }//
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...