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"
void encode(int n, int a[])
{
for (int i = 0; i < n; ++i)
send((1<<i)|(a[i]<<n));
}
// a[i] < 2^8
#include "decoder.h"
#include "decoderlib.h"
static const int N = 20;
static int ans[N];
void decode(int n, int l, int x[])
{
for (int i = 0; i < l; ++i) {
int b = x[i];
for (int j = 0; j < n; ++j) if (b>>j&1) {
ans[j] = b>>n;
}
}
for (int i = 0; i < n; ++i)
output(ans[i]);
}
// ans[i] < 2^8
# | 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... |