90pts 求调
查看原帖
90pts 求调
773998
RisefromtheDP楼主2024/10/11 21:00
#include<bits/stdc++.h>
#define int unsigned long long
using namespace std;
int n,k;
bool flag=0;
signed main(){
	ios::sync_with_stdio(false);
	cin>>n>>k;
	k++;
	while(k>0&&n>0){
		n--;
		if(k<=pow(2,n)){
			cout<<flag;
			flag=0;
		}
		else{
			cout<<!flag;
			flag=1;
			k-=pow(2,n);
		}
		cout<<' '<<k<<endl;
	}
	return 0;
}

WA on 17&20

2024/10/11 21:00
加载中...