0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-10 14:38:47 +00:00
OI-codes/problem/P5657/P5657.cpp
2020-11-18 21:51:09 +08:00

19 lines
343 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
unsigned long long n, k;
cin >> n >> k;
while ((--n) + 1) {
if ((1ull << n) - 1 < k) {
printf("1");
k = (1ull << n) - k + (1ull << n) - 1;
}
else {
printf("0");
}
}
cout << endl;
return 0;
}