Submission #567726

#TimeUsernameProblemLanguageResultExecution timeMemory
567726Stickfish"The Lyuboyn" code (IZhO19_lyuboyn)C++17
14 / 100
248 ms6452 KiB
#include <iostream> #include <vector> #include <bitset> using namespace std; const int MAXN = 18; vector<int> get_ans(int n, int k, int t) { if (k & 2) { return {}; } if (k == 1) { vector<int> ans = {0}; for (int i = 0; i < (1 << n) - 1; ++i) { int t = ((i ^ (i + 1)) + 1) >> 1; ans.push_back(ans.back() ^ t); } return ans; } return {}; } signed main() { int n, k, t; cin >> n >> k >> t; int s = 0; for (int i = 0; i < n; ++i) { char c; cin >> c; if (c == '1') s += 1 << i; } vector<int> ans = get_ans(n, k, t); if (ans.empty()) { cout << -1 << '\n'; return 0; } s ^= ans[0]; cout << (1 << n) << '\n'; for (auto& x : ans) { x ^= s; bitset<MAXN> bs = x; for (int i = 0; i < n; ++i) cout << bs[i]; cout << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...