许诺 • 12天前
#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=p2+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;
}
评论:
请先登录,才能进行评论