#include "encoder.h"
#include "encoderlib.h"
using namespace std;
void encode(int N, int M[]) {
for (int i = 0; i < N; i++) {
for (int j = 0; j < 8; j++) {
if (M[i] & (1 << j)) {
// bit i * N + j is on
send(i * N + j);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
int A[105];
void decode(int N, int L, int X[]) {
for (int i = 0; i < N; i++) {
A[i] = 0;
}
for (int i = 0; i < L; i++) {
int pos = X[i] / N, bit = X[i] % N;
A[pos] |= (1 << bit);
}
for (int i = 0; i < N; i++) {
output(A[i]);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
656 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
1028 KB |
Output is correct |
2 |
Correct |
1 ms |
1036 KB |
Output is correct |
3 |
Correct |
1 ms |
1004 KB |
Output is correct |
4 |
Correct |
1 ms |
1040 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
996 KB |
Output is correct |
2 |
Correct |
1 ms |
992 KB |
Output is correct |
3 |
Correct |
2 ms |
1012 KB |
Output is correct |
4 |
Correct |
1 ms |
1040 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
1032 KB |
Output is correct |
2 |
Correct |
1 ms |
996 KB |
Output is correct |
3 |
Incorrect |
0 ms |
536 KB |
Error : Bad encoded integer |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1 ms |
1048 KB |
Output is partially correct - P = 8.000000 |
2 |
Incorrect |
0 ms |
520 KB |
Error : Bad encoded integer |
3 |
Incorrect |
0 ms |
520 KB |
Error : Bad encoded integer |
4 |
Incorrect |
0 ms |
524 KB |
Error : Bad encoded integer |
5 |
Incorrect |
0 ms |
524 KB |
Error : Bad encoded integer |
6 |
Incorrect |
0 ms |
524 KB |
Error : Bad encoded integer |
7 |
Incorrect |
0 ms |
524 KB |
Error : Bad encoded integer |