# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
601406 | vh50 | Parrots (IOI11_parrots) | C++17 | 4 ms | 1060 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 N, int M[])
{
for(int i = 0; i < N; i++)
{
for(int j = 0; j < 4; j++)
{
int aux;
if(i > 15) i -= 16;
aux = (i << 4) + (j << 2);
i += 16;
aux += (M[i] & (3 << (2 * j))) >> (2 * j);
send(aux);
if(i > 15) send(aux);
}
}
}
#include <bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
void decode(int N, int L, int X[])
{
int marc[300];
vector <int> a, b;
for(int i = 0; i < L; i++) marc[X[i]]++;
for(int i = 0; i < L; i++)
{
if(marc[X[i]] == 1) a.push_back(X[i]);
if(marc[X[i]] == 2) b.push_back(X[i]);
}
sort(a.begin(), a.end());
sort(b.begin(), b.end());
for(int i = 0; i < a.size(); i += 4)
{
int aux = 0, c = 0;
for(int j = 0; j < 4; j++)
{
if(a[i + j] & 1) aux += (1 << (2 * j));
if(a[i + j] & 2) aux += (1 << (2 * j + 1));
}
output(aux);
}
for(int i = 0; i < b.size(); i += 4)
{
int aux = 0, c = 0;
for(int j = 0; j < 4; j++)
{
if(b[i + j] & 1) aux += (1 << (2 * j));
if(b[i + j] & 2) aux += (1 << (2 * j + 1));
}
output(aux);
}
}
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... |