#include <iostream>
#include <vector>
std::vector<bool> send_packet(std::vector<bool> A);
void send_message(std::vector<bool> M, std::vector<bool> C) {
for (bool c : C) send_packet(std::vector<bool>(31, c));
for (bool m : M) send_packet(std::vector<bool>(31, m));
}
std::vector<bool> receive_message(std::vector<std::vector<bool>> R) {
std::vector<bool> C(31);
for (int i = 0; i < 31; i++) {
int count = 0;
for (bool c : R[i]) {
if (c) count++;
else count--;
}
C[i] = count > 0 ? true : false;
}
std::vector<bool> result(R.size() - 31);
for (int i = 31; i < R.size(); i++) {
int count = 0;
for (bool c : R[i-31]) {
if (c) count++;
else count--;
}
result[i-31] = count > 0 ? true : false;
}
return std::move(result);
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |