Submission #1308715

#TimeUsernameProblemLanguageResultExecution timeMemory
1308715maya_sRack (eJOI19_rack)C++20
40 / 100
1 ms576 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    ll n, k; cin >> n >> k;
    ll p = (1ll << (n-1)), x = 0, d = 2;
    while(p) {
        if(k % d > d / 2 || k % d == 0) x += p;
        p /= 2, d *= 2;
    }
    cout << x+1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...