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;
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define pb push_back
#define f first
#define s second
void encode(int N, int M[])
{
vector<pair<int, int>> toSend;
int cnt = 0;
FOR(i, 0, N-1) {
int a = M[i] >> 4;
int b = M[i] - (a<<4);
toSend.pb({cnt++, a});
toSend.pb({cnt++, b});
}
for (auto p : toSend) {
send((p.f<<4) + p.s);
}
//for(i=0; i<N; i++)
// send(M[i]);
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define pb push_back
#define f first
#define s second
void decode(int N, int L, int X[])
{
vector<pair<int, int>> seq;
FOR(i, 0, L-1) {
int a = X[i] >> 4;
int b = X[i] - (a<<4);
seq.pb({a,b});
}
sort(seq.begin(), seq.end());
FOR(i, 0, N-1) {
int a = seq[2*i].s;
int b = seq[2*i+1].s;
int rez = (a<<4) +b;
output(rez);
}
}
# | 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... |