# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
290956 | 2020-09-04T15:02:57 Z | PeppaPig | "The Lyuboyn" code (IZhO19_lyuboyn) | C++14 | 845 ms | 18996 KB |
#include <bits/stdc++.h> using namespace std; int n, k, t, s; mt19937 rng(time(NULL)); void print(int val) { vector<int> vec; for(int i = 0; i < n; i++, val >>= 1) vec.emplace_back(val & 1); reverse(vec.begin(), vec.end()); for(int x : vec) printf("%d", x); printf("\n"); } chrono::steady_clock::time_point start; chrono::steady_clock::time_point get_now() { return chrono::steady_clock::now(); } int elapsed() { return (int)chrono::duration_cast<chrono::milliseconds>(get_now() - start).count(); } int main() { start = get_now(); scanf("%d %d %d", &n, &k, &t); for(int i = 0; i < n; i++) { char c; scanf("%c", &c); s = (s << 1) + (c == '1'); } vector<int> base; for(int i = 0; i < (1 << n); i++) if(__builtin_popcount(i) == k) base.emplace_back(i); while(elapsed() <= 500) { shuffle(base.begin(), base.end(), rng); vector<int> ans = {s}; for(int j = 0; j < n; j++) for(int i = (int)ans.size() - 1; ~i; i--) ans.emplace_back(ans[i] ^ base[j]); set<int> st(ans.begin(), ans.end()); if((int)st.size() == (1 << n)) { printf("%d\n", (1 << n)); for(int x : ans) print(x); exit(0); } } printf("-1\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | First number in answer is not x 1 2 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Ok |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 500 ms | 636 KB | Ok |
2 | Correct | 534 ms | 7820 KB | Ok |
3 | Correct | 512 ms | 4276 KB | Ok |
4 | Correct | 498 ms | 380 KB | Ok |
5 | Correct | 495 ms | 504 KB | Ok |
6 | Correct | 499 ms | 504 KB | Ok |
7 | Correct | 502 ms | 592 KB | Ok |
8 | Correct | 516 ms | 4132 KB | Ok |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 664 ms | 18792 KB | Ok |
2 | Correct | 300 ms | 9456 KB | Ok |
3 | Correct | 2 ms | 384 KB | Ok |
4 | Correct | 0 ms | 256 KB | Ok |
5 | Correct | 1 ms | 384 KB | Ok |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Ok |
2 | Correct | 16 ms | 800 KB | Ok |
3 | Incorrect | 509 ms | 4124 KB | Output -1 while solution exists |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 845 ms | 18996 KB | First number in answer is not x 44202 88404 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 664 ms | 18792 KB | Ok |
2 | Correct | 300 ms | 9456 KB | Ok |
3 | Correct | 2 ms | 384 KB | Ok |
4 | Correct | 0 ms | 256 KB | Ok |
5 | Correct | 1 ms | 384 KB | Ok |
6 | Correct | 1 ms | 384 KB | Ok |
7 | Correct | 16 ms | 800 KB | Ok |
8 | Incorrect | 509 ms | 4124 KB | Output -1 while solution exists |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 740 ms | 9304 KB | First number in answer is not x 92826 54580 |
2 | Halted | 0 ms | 0 KB | - |