# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
568395 | AndrejSh3 | Parrots (IOI11_parrots) | C++17 | 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<bits/stdc++.h>
#include"decoder.h"
#include"decoderlib.h"
/*
Strategy:
*) Encoder:
Encoder will send the following number: xxxxyyyyyyyy
xxxx is the index of the number in the original message
yyyyyyyy is the value of the number in the original message
*) Decoder:
Decoder will take the given numbers xxxxyyyyyyyy and create an array with the original message
*/
void recieveValue( int Xi, int &x, int &y ){
y = Xi & (0b11111111);
Xi >>= 8;
x = Xi;
}
void decode( int N, int L, int X[] ){
int A[N] = {};
int x, y;
for( int i = 0 ; i < L ; i++ ){
recieveValue( X[i], x, y );
A[x] = y;
}
for( int i = 0 ; i < N ; i++ ) output(A[i]);
}