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 <iostream>
void encode(int N, int M[])
{
int len = 0;
for(int i=0;i<N;i++){
int a = M[i];
for(int k=0;k<8;k++){
int b = a % 2;
a /= 2;
for(int j = 0;j < b;j++){
len++;
send(i * 8 + k);
//std::cout << i * 8 + k << " ";
}
}
}
//std::cout << "LEN IS " << len << '\n';
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[])
{
int cnt[8 * N];
memset(cnt, 0, sizeof(cnt));
for(int i=0;i<L;i++){
cnt[X[i]]++;
}
int M[N];
int grr[] = {1, 2, 4, 8, 16, 32, 64, 128};
for(int i=0;i<N;i++){
M[i] = 0;
for(int j=8*i;j<8*i+8;j++){
M[i] += cnt[j] * (grr[j - 8*i]);
}
output(M[i]);
//cout << M[i] << " ";
}
}
# | 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... |