diff --git a/problem/P5657/P5657.cpp b/problem/P5657/P5657.cpp new file mode 100644 index 00000000..e1393ab5 --- /dev/null +++ b/problem/P5657/P5657.cpp @@ -0,0 +1,19 @@ +#include + +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; +} \ No newline at end of file