#include "encoder.h"
#include "encoderlib.h"
void encode(int N, int M[]) {
for(int i = 0; i < 8 * N; i++) {
send((i * 2) | ((M[i / 8] >> (7 - i % 8)) & 1));
}
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[]) {
int a[N * 8];
for(int i = 0; i < L; i++)
a[X[i] >> 1] = X[i] & 1;
for(int i = 0; i < N; i++) {
int num = 0;
for(int j = i * 8; j < (i + 1) * 8; j++)
num = num * 2 + a[j];
output(num);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
752 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
1992 KB |
Output is correct |
2 |
Correct |
7 ms |
1992 KB |
Output is correct |
3 |
Correct |
8 ms |
2088 KB |
Output is correct |
4 |
Correct |
8 ms |
2120 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2208 KB |
Output is correct |
2 |
Correct |
6 ms |
2208 KB |
Output is correct |
3 |
Correct |
7 ms |
2216 KB |
Output is correct |
4 |
Correct |
8 ms |
2480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2480 KB |
Output is correct |
2 |
Correct |
8 ms |
2480 KB |
Output is correct |
3 |
Incorrect |
6 ms |
2480 KB |
Error : Bad encoded integer |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
10 ms |
2480 KB |
Output is partially correct - P = 8.000000 |
2 |
Incorrect |
4 ms |
2480 KB |
Error : Bad encoded integer |
3 |
Incorrect |
5 ms |
2480 KB |
Error : Bad encoded integer |
4 |
Incorrect |
4 ms |
2480 KB |
Error : Bad encoded integer |
5 |
Incorrect |
4 ms |
2480 KB |
Error : Bad encoded integer |
6 |
Incorrect |
5 ms |
2480 KB |
Error : Bad encoded integer |
7 |
Incorrect |
4 ms |
2480 KB |
Error : Bad encoded integer |