#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#include"communication.h"
void encode(int n, int x) {
if (x == 1) {
int last = 0;
for (int i = 0; i < 250; i++) {
int va = send(last);
last = va;
}
} else {
for (int i = 0; i < 250; i++) {
int va = send(0);
}
}
}
pair<int, int> decode(int n) {
bool ok = 1;
int prev = 0;
for (int i = 0; i < 250; i++) {
int va = receive();
if (va == 1 && prev == 1)
ok = 0;
prev = va;
}
if (ok) {
return {2, 3};
} else {
return {1, 2};
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |