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[])
{
for(int i = 0;i < N;i++){
send(i*8+(M[i]&3));
send(i*8+(M[i]&3));
send(i*8+(M[i]>>2&3));
send(i*8+4+(M[i]>>4&3));
send(i*8+4+(M[i]>>4&3));
send(i*8+4+(M[i]>>6&3));
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <vector>
#include <algorithm>
static std::pair<int, int> gh(int a, int b, int c){
int f = a^b^c;
if(f==a) return {b^(b&4),f^(f&4)};
return {a^(a&4),f^(f&4)};
}
void decode(int N, int L, int X[])
{
std::vector<int> a[N];
for(int i=0; i<L; i++) {
a[X[i]>>3].push_back(X[i]&7);
}
for(int i = 0;i < N;i++){
std::sort(a[i].begin(), a[i].end());
auto vl = gh(a[i][0], a[i][1], a[i][2]), vr = gh(a[i][3],a[i][4],a[i][5]);
output(vl.first+4*vl.second+16*vr.first+64*vr.second);
}
}
# | 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... |