#include<bits/stdc++.h>
using namespace std;
int D, N;
int main() {
while (scanf("%d%d", &D, &N)!=EOF) {
int k = 1;
for (int i = 0; i < D - 1; i++) {
if (N % 2) {
k = k * 2;
N = (N + 1) / 2;
} else {
k = k * 2 + 1;
N /= 2;
}
}
printf("%d\n", k);
}
}
posted on
2017-04-29 21:23NWU_ACM
阅读(141)
评论(0)
编辑收藏举报