#include "encoder.h"
#include "encoderlib.h"
void encode(int N, int M[])
{
if (N <= 16)
{
int sz = 0, v[100];
for (int i=0; i<N; i++)
for (int j=0; j<8; j++)
v[sz ++] = (M[i] >> j) & 1;
for (int i=0; 2 * i < sz; i++)
{
int msk = (i << 2) | (v[2 * i] << 1) | v[2 * i + 1];
send (msk);
}
}
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[])
{
if (N <= 16)
{
int v[100];
for (int i=0; i<L; i++)
{
int pos = X[i] >> 2;
v[2 * pos + 1] = X[i] & 1;
v[2 * pos] = (X[i] >> 1) & 1;
}
for (int j=0; j<2 * L; j+=8)
{
int msk = 0;
for (int k=j; k<j + 8; k++)
if (v[k])
msk |= 1 << (k - j);
output (msk);
}
return ;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
2000 KB |
Output is correct |
2 |
Correct |
5 ms |
2000 KB |
Output is correct |
3 |
Runtime error |
3 ms |
1000 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
2272 KB |
Output is correct |
2 |
Correct |
5 ms |
2272 KB |
Output is correct |
3 |
Runtime error |
2 ms |
1136 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
2320 KB |
Output is correct |
2 |
Runtime error |
3 ms |
1160 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
1160 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Incorrect |
5 ms |
2320 KB |
Error : Output length must be N |
3 |
Incorrect |
4 ms |
2320 KB |
Error : Output length must be N |
4 |
Incorrect |
5 ms |
2320 KB |
Error : Output length must be N |
5 |
Incorrect |
5 ms |
2344 KB |
Error : Output length must be N |
6 |
Incorrect |
5 ms |
2344 KB |
Error : Output length must be N |
7 |
Incorrect |
5 ms |
2344 KB |
Error : Output length must be N |