Wa #15 #16
#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
bool t[70];
signed main() {
ull n,k,l,r,cnt,tot;
scanf("%llu %llu",&n,&k);
l = 0, r = tot = pow(2,n) - 1, cnt = 0;
while(l < r) {
ull mid = (l + r) >> 1;
if(k > mid) {
t[++cnt] = 1, k = (tot - k);
}
else {
t[++cnt] = 0;
}
r = mid;
tot >>= 1;
}
for(ull i = 1; i <= n; i ++) cout << t[i];
return 0;
}