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[])
{
for(int i=0;i<N;i++){
int st = i;
int tmpst = 0;
vector<int> bitss(8);
for(int j=4;j>=0;j--){
if(st&(1<<j)){
bitss[3+j]=1;
}
}
for(int k=0;k<=7;k++){
if(bitss[k]){
tmpst += (1<<k);
}
}
for(int j=0;j<=7;j++){
if(M[i]&(1<<j)){
vector<int> tmp = bitss;
for(int k=0;k<3;k++){
if((1<<k)&j){
tmp[k]=1;
}
}
int num = 0;
for(int k=0;k<=7;k++){
if(tmp[k]==0) continue;
num += (1<<k);
}
send(num);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[])
{
vector<int> v(N+5);
int lol = (1<<6) | (1<<5) | (1<<4) | (1<<3);
int l2 = 1 | (1<<1) | (1<<2);
for(int i=0;i<L;i++){
int pos = (X[i]&(lol))>>3;
int bit = X[i]&l2;
int val = (1<<bit);
v[pos] = v[pos] ^ val;
}
for(int i=0;i<N;i++) output(v[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... |