# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26900 | sgc109 | Parrots (IOI11_parrots) | C++11 | 6 ms | 2176 KiB |
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 M[])
{
for(int i = 0 ; i < N; i++){
for(int j = 0 ; j < 4; j++){
int data = (M[i] & (3<<(2*j))) >> (2*j);
int bit = 0;
bit |= (i<<4);
bit |= (j<<2);
bit |= data;
send(bit);
}
}
}
#include "decoder.h"
#include "decoderlib.h"
int M[16];
int found[16];
void decode(int N, int L, int X[])
{
for(int i = 0 ; i < 16; i++) found[i] = 0, M[i] = 0;
int i, b;
for(i=0; i<L; i++) {
int data = X[i] & 3;
X[i] >>= 2;
int piece = X[i] & 3;
X[i] >>= 2;
int order = X[i] & 15;
M[order] |= (data << (2*piece));
found[order] = 1;
}
for(int i = 0 ; i < 16 && found[i]; i++){
output(M[i]);
}
}
Compilation message (stderr)
# | 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... |