# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
223962 | Kenzo_1114 | Parrots (IOI11_parrots) | C++14 | 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.
void encode(int n, int m[])
{
for(int i = 0; i < n; i++)
{
for(int k = 7; k >= 0; k--)
if(m[i] & (1 << k)) send(k + 8 * i);
}
}
void decode(int n, int l, int x[])
{
int id = 0;
for(int i = 0; i < n; i++)
{
int num = 0;
for(int k = 7; k >= 0; k--)
if(id < l && x[id] == k + 8 * i)
num += (1 << k), id++;
output(num);
}
}