# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
39243 | steve11344 | Parrots (IOI11_parrots) | C++14 | 5 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[])
{
int i;
int priority=0;
int message = 0;
int mymaptbl[4] ={0xC0,0x30,0x0C,0x03};
for(i=0; i<N; i++){
message = 0;
priority = i;
for(int j = 0 ; j < 4; j++){
message |= priority<<4;
message |= j<<2;
message |= (M[i]&mymaptbl[j])>>(6-(2*j));
send(message);
message = 0;
}
}
return;
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[])
{
int i, b,prio,place=0;
int arr[32]={0,};
for(i=0; i<L; i++) {
prio = X[i];
prio = prio>>4;
place = (X[i]&0x0C)>>2;
arr[prio] |= ((X[i]&0x03)<<(6-(2*place)));
}
for(int i = 0 ; i<N; i++) output(arr[i]);
return;
}
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... |