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 <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"
//#include "decoder.h"
//#include "decoderlib.h"
using namespace std;
void encode(int N, int M[]){
for(int i = 0; i < N; i ++){
int t = M[i];
int a = t % 4, b = t / 4 % 4, c = t / 16 % 4, d = t / 64 % 4;
int aa = i * 4 * 4, bb = (i * 4 + 1) * 4, cc = (i * 4 + 2) * 4, dd = (i * 4 + 3) * 4;
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
if(i > 15){
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
}
}
}
#include <bits/stdc++.h>
//#include "encoder.h"
//#include "encoderlib.h"
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
void decode(int N, int L, int X[]){
map<int, int> arr;
for(int i = 0; i < L; i++){
arr[X[i]]++;
}
vector<int> left, right, ans(N), brr;
for(auto[l, r] : arr){
if(r % 2){
left.push_back(l);
}
if(r > 1){
right.push_back(l);
}
}
vector<int> ord = left;
for(int i: right){
ord.push_back(i);
}
for(int i = 0; i < N; i ++){
int a = ord[i * 4] % 4 + ord[i * 4 + 1] % 4 * 4 + ord[i * 4 + 2] % 4 * 16 + ord[i * 4 + 3] % 4 * 64;
output(a);
}
}
# | 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... |