# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
199141 | godwind | Parrots (IOI11_parrots) | C++14 | 0 ms | 0 KiB |
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;
int base[10];
void pre() {
base[0] = 1;
for (int i = 1; i < 9; ++i) {
base[i] = base[i - 1] * 10;
}
}
int len(int x) {
if (x == 0) return 1;
int l = 0;
while (x) {
x /= 10;
++l;
}
return l;
}
void encode(int n, int M[]) {
pre();
for (int i = 0; i < n; ++i) {
int x = i * base[3] + M[i];
send(x);
}
}
#include "decoder.h"
#include "decoderlib.h"
#include< bits/stdc++.h>
int ans[1000];
// void output(int x) {
// cout << x << endl;
// }
void decode(int n, int L, int X[]) {
for (int i = 0; i < L; ++i) {
int x = X[i] % 1000;
X[i] /= 1000;
int id = X[i];
ans[id] = x;
}
for (int i = 0; i < n; ++i) {
output(ans[i]);
}
}