#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define sp <<" "<<
#define endl "\n"
void encode(int N, int M[]) {
for (int i = 0; i < N; i++) {
cerr << M[i] << endl;
}
unordered_set<int> one;
for (int i = 0; i < N; i++) {
for (int j = 0; j < 8; j++) {
if (M[i] & (1 << j)) {
one.insert(i * 8 + j);
}
}
}
for (auto &x : one) {
send(x);
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define sp <<" "<<
#define endl "\n"
void decode(int N, int L, int X[]) {
vector<int> M(N, 0);
for (int i = 0; i < L; i++) {
int pos = X[i] / 8, bit = X[i] % 8;
M[pos] |= (1 << bit);
}
for (int i = 0; i < N; i++) {
cerr << M[i] << endl;
}
for (auto &x : M) {
output(x);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |