This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "encoder.h"
#include "encoderlib.h"
#define FOR(i, begin, end) for(int i=(begin); i<(end); i++)
void encode(int n, int m[])
{
FOR(i, 0, n)
{
int pos=i;
FOR(j, 0, 8)
{
if(m[i]&(1<<j)){
int bit=j, snd=pos|(bit<<5);
send(snd);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#define FOR(i, begin, end) for(int i=(begin); i<(end); i++)
void decode(int n, int l, int x[])
{
int ans[n]; FOR(i, 0, n) ans[i]=0;
FOR(i, 0, l)
{
int pos=x[i]&31, bit=x[i]>>5;
ans[pos]^=1<<bit;
}
FOR(i, 0, n)
{
output(ans[i]);
}
}
# | 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... |