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>
void encode(int N, int M[]) {
if(N<=32){
for(int i=0;i<N;i++)
for(int k=0;k<8;k++)
if((M[i]>>k)&1)send(N*k+i);
}else{
for(int i=0;i<32;i++){
for(int k=0;k<8;k++){
if(i+32<N){
if( ((M[i]>>k)&1) && ((M[i+32]>>k)&1) ){
send(32*k+i);
send(32*k+i);
}else if((M[i+32]>>k)&1){
send(32*k+i);
send(32*k+i);
send(32*k+i);
}else if((M[i]>>k)&1){
send(32*k+i);
}
}else if((M[i]>>k)&1)send(32*k+i);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 1e5+50;
const ll oo = 1e18;
const ll mod = 1e9+7;
int num[200],f[300];
void decode(int N, int L, int X[]){
memset(num,0,sizeof(num));
memset(f,0,sizeof(f));
if(N<=32){
for(int i=0;i<L;i++)num[X[i]%N] += (1<<(X[i]/N));
}else{
for(int i=0;i<L;i++)f[X[i]]++;
for(int i=0;i<256;i++){
if(f[i]==1){
num[i%32] |= (1<<(i/32));
}else if(f[i]==3){
num[(i%32)+32] |= (1<<(i/32));
}else if(f[i]==2){
num[i%32] |= (1<<(i/32));
num[(i%32)+32] |= (1<<(i/32));
}
}
}
for(int i=0;i<N;i++)output(num[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... |