# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
65837 | josw530 | Parrots (IOI11_parrots) | C++98 | 0 ms | 0 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"
int BIT_MASK[8] = {
0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01
};
void encode(int N, int M[])
{
int i;
for(i=0; i<N; i++)
{
for(int j = 0; j<8; j++)
{
if(M[i]&BIT_MASK[j])
send(i*8 + j);
}
}
}
#include "decoder.h"
#include "decoderlib.h"
int BIT_MASK[8] = {
0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01
};
void decode(int N, int L, int X[])
{
int i, b;
int msg[32] = {0};
for(i=0; i<L; i++) {
msg[X[i]/8] |= BIT_MASK[(X[i]%8];
}
for(i=0; i<N; i++) {
output(msg[i]);
}
}