# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
403057 | 2021-05-12T17:26:40 Z | peuch | "The Lyuboyn" code (IZhO19_lyuboyn) | C++17 | 419 ms | 7596 KB |
#include<bits/stdc++.h> using namespace std; const int MAXN = 1 << 19; int n, k, t, s; int marc[MAXN]; vector<int> getK1(int n); int scanBit(int tam); void printBit(int tam, int val); int main(){ scanf("%d %d %d", &n, &k, &t); s = scanBit(n); if(k % 2 == 0){ printf("-1\n"); return 0; } vector<int> ord = getK1(n); vector<int> ans; for(int i = 0; i < ord.size(); i++){ ans.push_back(s); for(int j = 0; j < n; j++){ if((1 << j) & ord[i]){ for(int x = 0; x < k; x++){ int cur = (j + x) % n; ans[i] ^= (1 << cur); } } } } int cnt = 0; printf("%d\n", 1 << n); for(int i = 0; i < ans.size(); i++) printBit(n, ans[i]); } vector<int> getK1(int n){ vector<int> ret; if(n == 1){ ret.push_back(0); ret.push_back(1); return ret; } vector<int> aux = getK1(n - 1); for(int i = 0; i < aux.size(); i++) ret.push_back(aux[i]); for(int i = aux.size() - 1; i >= 0; i--){ ret.push_back(aux[i] | (1 << (n - 1))); } return ret; } int scanBit(int tam){ int ret = 0; for(int i = tam - 1; i >= 0; i--){ char aux; scanf(" %c", &aux); if(aux == '1') ret |= (1 << i); } return ret; } void printBit(int tam, int val){ for(int i = tam - 1; i >= 0; i--){ if((1 << i) & val) printf("1"); else printf("0"); } printf("\n"); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Ok |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 296 KB | Ok |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Ok |
2 | Correct | 1 ms | 204 KB | Ok |
3 | Correct | 1 ms | 204 KB | Ok |
4 | Correct | 1 ms | 304 KB | Ok |
5 | Correct | 1 ms | 204 KB | Ok |
6 | Correct | 1 ms | 204 KB | Ok |
7 | Correct | 1 ms | 204 KB | Ok |
8 | Correct | 1 ms | 204 KB | Ok |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 222 ms | 7388 KB | Ok |
2 | Correct | 102 ms | 3768 KB | Ok |
3 | Correct | 1 ms | 204 KB | Ok |
4 | Correct | 1 ms | 204 KB | Ok |
5 | Correct | 1 ms | 204 KB | Ok |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Ok |
2 | Correct | 6 ms | 436 KB | Ok |
3 | Correct | 118 ms | 3828 KB | Ok |
4 | Correct | 57 ms | 2008 KB | Ok |
5 | Incorrect | 1 ms | 204 KB | The values in the output sequence are not pairwise distinct! |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 308 ms | 7444 KB | Ok |
2 | Correct | 271 ms | 7464 KB | Ok |
3 | Incorrect | 252 ms | 7456 KB | The values in the output sequence are not pairwise distinct! |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 222 ms | 7388 KB | Ok |
2 | Correct | 102 ms | 3768 KB | Ok |
3 | Correct | 1 ms | 204 KB | Ok |
4 | Correct | 1 ms | 204 KB | Ok |
5 | Correct | 1 ms | 204 KB | Ok |
6 | Correct | 1 ms | 204 KB | Ok |
7 | Correct | 6 ms | 436 KB | Ok |
8 | Correct | 118 ms | 3828 KB | Ok |
9 | Correct | 57 ms | 2008 KB | Ok |
10 | Incorrect | 1 ms | 204 KB | The values in the output sequence are not pairwise distinct! |
11 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 195 ms | 3732 KB | Ok |
2 | Correct | 419 ms | 7412 KB | Ok |
3 | Correct | 336 ms | 7596 KB | Ok |
4 | Correct | 16 ms | 716 KB | Ok |
5 | Correct | 1 ms | 204 KB | Ok |
6 | Correct | 39 ms | 1280 KB | Ok |
7 | Correct | 260 ms | 7484 KB | Ok |
8 | Incorrect | 1 ms | 304 KB | The values in the output sequence are not pairwise distinct! |
9 | Halted | 0 ms | 0 KB | - |