# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1016485 | nisanduu | 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"
void encode(int N, int M[])
{
int i;
for(i=0; i<N; i++)
int num = i;
string st = to_string(num);
string s2 = to_string(M[i]);
string f = st+s2;
int number = stoi(f);
send(number);
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[])
{
int i, b;
map<int,int> mp;
for(i=0; i<L; i++) {
b = X[i];
string s = to_string(b);
int n = s.length();
char d = s[n-1];
int digit = (d - '0');
string tmp = "";
for(int j=0;j<n-1;j++){
tmp += s[j];
}
int num = stoi(tmp);
mp[num] = digit;
}
for(auto z:mp){
output(z.second);
}
}