#include<iostream>
using namespace std;
int n,k,p;
bool tree[1<<20];
void cyx()
{
int i;p=1;
for(i=2;i<=n;i++)
if(tree[p])
{
tree[p]=0;p=p*2+1;
}
else
{
tree[p]=1;p*=2;
}
}
int main()
{
int i;
cin>>n>>k;
for(i=1;i<=k;i++) cyx();
cout<<p;
return 0;
}
全部回复 共 0 条
还没有人回复。往下写第一条。
发表回复
登录后即可回复本帖,与出题人和同学一起讨论。
登录