# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
628089 | abcvuitunggio | Parrots (IOI11_parrots) | C++17 | 2 ms | 1036 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++){
while (M[i]){
v.push_back(M[i]%4);
M[i]/=4;
}
}
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/4;i++){
int res=0;
for (int j=3;j>=0;j--)
res=res*4+X[i*4+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... |