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"
void encode(int N, int M[]){
int i;
for(i=0; i<N; i++){
send(M[i]);
send(M[i] ^ i);
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
int a[65];
void decode(int N, int L, int X[])
{
multiset<int> in;
int i;
for(i=0; i<L; i++){
in.insert(X[i]);
//output(b);
}
while(!in.empty()){
for(int x : in){
bool ok = 0;
for(int i = 0; i < N; i++){
if(!in.count(x ^ i)) continue;
ok = 1;
a[i] = x;
in.erase(in.find(x));
in.erase(in.find(x ^ i));
}
if(ok) break;
}
}
for(int i = 0; i < N; i++){
output(a[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... |