AC

许诺 · 发布于 2025-07-31 · 浏览 356 回复 0
	#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 条

还没有人回复。往下写第一条。

发表回复