#include <bits/stdc++.h>
using namespace std;
#include "encoder.h"
#include "encoderlib.h"
void encode(int N, int M[]){
bool bs[N*8];
memset(bs, 0, sizeof(bs));
for (int x = 0; x < N; x++){
for (int z = 0; z < 8; z++){
bs[x*8 + z] = ((M[x] & (1<<z)) != 0);
}
}
for (int x = 0; x < N; x++){
for (int z = 0; z < 8; z++){
if (bs[x*8+z]) send(x*8+z);
}
}
}
#include <bits/stdc++.h>
using namespace std;
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[]){
bool bs[N*8];
memset(bs, 0, sizeof(bs));
for (int x = 0; x < L; x++){
bs[X[x]] = 1;
}
int res[N]; memset(res, 0, sizeof(res));
for (int x = 0; x < N; x++){
for (int z = 0; z < 8; z++){
res[x] += bs[z] * (1<<z);
}
}
for (int x = 0; x < N; x++){
output(res[x]);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
804 KB |
Error : Output is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1312 KB |
Error : Output is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1316 KB |
Error : Output is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1316 KB |
Error : Output is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1316 KB |
Error : Output is wrong |
2 |
Halted |
0 ms |
0 KB |
- |