# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
711387 | mseebacher | 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 "encoder.h"
#include "encoderlib.h"
using namespace std;
void encode(int x, int m[]){
for(int i = 0;i<x;i++){
int y = m[i];
for(int j = 0;j<8;j++){
if((1<<j)&m[i])
y |= (1 << (8+j));
}
send(y);
}
}
#include <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"
using namespace std;
void decode(int x,int l,int m[]){
vector<int> ans(x+1);
for(int i = 0;i<x;i++){
int index = 0;
for(int j = 8;j<=16;j++){
if(m[i] & 1 << (j)){
m[i] -= (1 << j);
index += (1 << (j-8));
}
}
ans[index] = m[i];
}
for(int i = 1;i<=x;i++){
output(ans[i]);
}
}