95分,#18wa了,求助大佬
查看原帖
95分,#18wa了,求助大佬
800751
acmwriter楼主2024/8/12 23:00
#include<bits/stdc++.h>
using namespace std;
unsigned long long n,k,tot,t;
int main(){
    cin>>n>>k;
    for(int i=n;i>=1;i--){
        tot=pow(2,i)-1;
        t=tot/2;
        if(k>t){
            cout<<1;
            k=tot-k;
        }
        else {
            cout<<0;
        }
    }
    return 0;
}
2024/8/12 23:00
加载中...