#include"communication.h"
#include <bits/stdc++.h>
#define IO_OP ios::sync_with_stdio(0), cin.tie(0)
#define F first
#define S second
#define V vector
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;
const int INF = 1e9 + 7;
void encode(int n, int x) {
x = x > 1;
for(int i = 0; i < 99; i++) {
if(send(0)) {
send(x);
return;
}
}
assert(send(x) == x);
}
std::pair<int, int> decode(int n) {
for(int i = 0; i < 99; i++) {
if(receive()) {
int x = receive();
return {x + 1, x + 2};
}
}
int x = receive();
return {x + 1, x + 2};
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
1724 KB |
Output is correct |
2 |
Runtime error |
2 ms |
420 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
200 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |