# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
406573 | Ronin13 | Rack (eJOI19_rack) | C++14 | 12 ms | 6592 KiB |
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 ll long long
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ull unsigned ll
#define pb push_back
#define epb emplace_back
#define INF 1e9+1;
using namespace std;
void solve(){
int n,k;cin>>n>>k;
vector<int>vec;
vec.pb(1);
vec.pb((1<<(n-1))+1);
int j=(1<<(n-1));
j/=2;
while(j){
vector<int>add;
for(int i=0;i<vec.size();i++){
add.pb(vec[i]+j);
}
for(int to:add)vec.pb(to);
j/=2;
}
cout<<vec[k-1]<<' ';
}
int main(){
int t;t=1;
while(t--){
solve();
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |