#include"communication.h"
#include <bits/stdc++.h>
using namespace std;
void encode(int N, int X) {
for (int i = 0; i < 100; i++) send(N > 2);
}
pair<int, int> decode(int N) {
int cnt[2] = {0, 0};
for (int i = 0; i < 100; i++) cnt[receive()]++;
if (cnt[0] > cnt[1]) return {1, 2};
else return {2, 3};
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
41 ms |
200 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
426 ms |
200 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |