communication.cpp: In function 'void encode(int, int)':
communication.cpp:17:14: error: 'x' was not declared in this scope
17 | send(x%2);
| ^
communication.cpp: At global scope:
communication.cpp:23:1: error: 'vector' does not name a type
23 | vector<int> a, res;
| ^~~~~~
communication.cpp: In function 'void brute_force(int, int, bool)':
communication.cpp:25:15: error: 'a' was not declared in this scope
25 | if(i*3 == a.size()){
| ^
communication.cpp:26:9: error: 'res' was not declared in this scope
26 | res.push_back(x);
| ^~~
communication.cpp:30:12: error: 'a' was not declared in this scope
30 | if(a[j] != a[j+1] && a[j] != a[j+2])
| ^
communication.cpp:32:29: error: 'a' was not declared in this scope
32 | brute_force(x * 2 + a[i*3], i+1, a[i*3] == a[i*3+2]);
| ^
communication.cpp:36:8: error: 'a' was not declared in this scope
36 | if(a[j] == a[j+1])
| ^
communication.cpp: In function 'std::pair<int, int> decode(int)':
communication.cpp:46:5: error: 'a' was not declared in this scope
46 | a.clear();
| ^
communication.cpp:53:5: error: 'res' was not declared in this scope
53 | res.clear();
| ^~~
communication.cpp:55:5: error: 'sort' was not declared in this scope; did you mean 'short'?
55 | sort(res.begin(), res.end());
| ^~~~
| short
communication.cpp:58:47: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::pair<int, int>'
58 | if(res.size() == 1) return {res[0], res[0]};
| ^
| |
| <brace-enclosed initializer list>
communication.cpp:59:13: error: 'rnd' was not declared in this scope
59 | int i = rnd() % res.size();
| ^~~
communication.cpp:60:12: error: 'j' was not declared in this scope
60 | while((j = rnd() % res.size()) != i);
| ^
communication.cpp:61:25: error: 'j' was not declared in this scope
61 | return {res[i], res[j]};
| ^
communication.cpp:61:27: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::pair<int, int>'
61 | return {res[i], res[j]};
| ^
| |
| <brace-enclosed initializer list>