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){
int k = 0;
int cur = m[i];
while (cur > 0){
int x = cur % 3;
for (int l = 0; l < x; ++l) send(k * n + i);
k++;
cur /= 3;
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include "bits/stdc++.h"
using namespace std;
void decode(int n, int l, int x[]){
vector<int> v(n);
for (int i = 0; i < l; ++i){
v[x[i] % n] += pow(3, x[i] / n);
}
for (int i = 0; i < n; ++i) output(v[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... |