0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-05 02:06:27 +00:00
OI-codes/Luogu/P5657/P5657.cpp

18 lines
335 B
C++
Raw Normal View History

2020-11-18 13:51:09 +00:00
#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;
2021-11-19 09:01:13 +00:00
} else {
2020-11-18 13:51:09 +00:00
printf("0");
}
}
cout << endl;
return 0;
}