// incorrect/kostka_from_statement.cpp
#include "bits/stdc++.h"
#include "message.h"
using namespace std;
using Message = vector<bool>;
using Packet = vector<bool>;
const int BITS = 31;
void send_message(Message M, vector<bool> C) {
for (int i = 0; i < (int)M.size(); i += 2) {
Packet p(BITS);
int mine = 0;
for (int b = 0; b < BITS; b++) {
if (!C[b]) {
p[b] = M[i + (mine / 8)];
mine++;
}
}
assert(mine == 16);
send_packet(p);
}
}
Message receive_message(vector<Packet> R) {
Message result;
for (int i = 0; i < (int)R.size(); i++) {
vector<bool> repeated;
for (int b = 0; b + 1 < BITS; b++) {
if (R[i][b] == R[i][b + 1])
repeated.push_back(R[i][b]);
}
result.push_back(repeated.front());
result.push_back(repeated.back());
}
return result;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
664 KB |
Used 2 days |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
412 ms |
404 KB |
decoded message is incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
664 KB |
Used 2 days |
2 |
Incorrect |
412 ms |
404 KB |
decoded message is incorrect |
3 |
Halted |
0 ms |
0 KB |
- |