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"
using namespace std;
void encode(int N, int M[])
{
for (int i = 0; i < N; i++)
{
for (int j = 0; j < 4; j++)
{
int s = 1;
if ((1 << j) & M[i]) s--;
if ((1 << (j + 4)) & M[i]) s += 2;
while (s--) send(i * 4 + j);
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <iostream>
using namespace std;
int cl[100][4], col[100];
void decode(int N, int L, int X[])
{
//cout << N << endl;
for (int i = 0; i < L; i++) cl[X[i] / 4][X[i] % 4]++;
for (int i = 0; i < N; i++)
{
for (int j = 0; j < 4; j++)
{
int sm = cl[i][j];
if ((sm & 1) == 0) col[i] += (1 << j);
if (sm & 2) col[i] += (1 << (j + 4));
cl[i][j] = 0;
}
}
for (int i = 0; i < N; i++) output(col[i]), col[i] = 0;
}
# | 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... |