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;
int n;
void encode(int N, int M[]) {
n = N;
int def = 0;
for(int i=0;i<N;i++) {
def = i;
for(int j=0;j<8;j++) {
if(M[i] & (1<<j)) {
// on bit
int curr = def;
for(int bit=0;bit<3;bit++) {
if(j&(1<<bit)) {
curr |= (1<<(bit + 5));
}
}
send(curr);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
const int maxn = 35;
int arr[maxn];
void decode(int N, int L, int X[]) {
for(int i=0;i<L;i++) {
int position = 0;
for(int j=0;j<5;j++) {
if(X[i] & (1<<j)) {
position |= (1<<j);
}
}
int index = 0;
for(int j=5;j<8;j++) {
if(X[i] & (1<<j)) {
index |= (1<<(j-5));
}
}
arr[position] |= (1<<index);
}
for(int i=0;i<N;i++) {
output(arr[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... |