This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int h[1 << 17];
int main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
for (int i = 0; i < (1 << n); i++) cin >> h[i];
cout << 0 << '\n';
int zero_pos = find(h, h + (1 << n), 0) - h;
int one_pos = find(h, h + (1 << n), 1) - h;
for (int i = 0; i < n; i++) {
cout << 2;
if (zero_pos & (1 << i)) cout << 1;
}
for (int j = 0; j < __builtin_ctz(one_pos ^ zero_pos); j++)
cout << 2;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |