# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
628118 | abcvuitunggio | Parrots (IOI11_parrots) | C++17 | 2 ms | 1040 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"
#include <bits/stdc++.h>
using namespace std;
void encode(int N, int M[])
{
vector <int> v;
for (int i=0;i<N;i++){
for (int j=0;j<8;j++){
v.push_back(M[i]%2);
M[i]/=2;
}
}
for (int i=1;i<v.size();i++)
v[i]+=v[i-1];
for (int i:v)
send(i);
}
#include "decoder.h"
#include "decoderlib.h"
#include <algorithm>
using namespace std;
void decode(int N, int L, int X[])
{
sort(X,X+L);
for (int i=L;i;i--)
X[i]-=X[i-1];
for (int i=0;i<L/8;i++){
int res=0;
for (int j=7;j>=0;j--)
res=res*2+X[i*2+j];
output(res);
}
}
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... |