Submission #751399

#TimeUsernameProblemLanguageResultExecution timeMemory
751399ereringRack (eJOI19_rack)C++17
40 / 100
1 ms324 KiB
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define mod 1000000007 #define ll long long #define inf INT_MAX #define pb push_back const int N=(1<<18); int main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); ll n,k; cin>>n>>k; ll l=1,r=(1<<n); k--; for(ll i=0;i<n;i++){ if(k%2==0){ r=(l+r)/2; } else{ l=(l+r)/2+1; } k/=2; } cout<<l; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...