#include "message.h"
#include <bits/stdc++.h>
using namespace std;
void send_message(vector<bool> m, vector<bool> c) {
vector<bool> A(31, 0);
int s = m.size();
for(int i = 0; i < s; i++){
if(A[i] == 1){
vector<bool> aux (31 , 1);
send_packet(aux);
}
else{
vector<bool> aux (31 , 0);
send_packet(aux);
}
}
return;
}
vector<bool> receive_message(vector<vector<bool>> R) {
int n = R.size();
vector<bool> ans;
for(int i = 0; i < n; i++){
int ones = 0 , ceros = 0;
for(int j = 0; j < 31; j++){
if(R[i][j] == 1) ones++;
else ceros++;
}
if(ones > ceros) ans.push_back(1);
else ans.push_back(0);
}
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |