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[]){
int i;
for(i=0; i<N; i++){
send(M[i]);
send(i);
send(M[i] ^ i);
send(M[i] & i);
send(M[i] | i);
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
int cnt[400];
void decode(int N, int L, int X[])
{
for(int i=0; i<L; i++){
cnt[X[i]]++;
}
int t[5];
for(int i = 0; i < N; i++){
int j;
for(j = 0; j < 256; j++){
t[0] = i;
t[1] = j;
t[2] = i ^ j;
t[3] = i & j;
t[4] = i | j;
for(int l = 0; l < 5; l++){
cnt[t[l]]--;
}
bool ok = 1;
for(int l = 0; l < 5; l++)
if(cnt[t[l]] < 0) ok = 0;
if(ok) break;
for(int l = 0; l < 5; l++)
cnt[t[l]]++;
}
output(j);
}
}
# | 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... |