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 get(string s){
stringstream ss;
ss << s;
int x;
ss >> x;
return x;
}
void encode(int N, int M[])
{
for(int i = 0; i < N; ++i){
int x = M[i];
++x;
string s = to_string(x);
while(s.size() < 3){
s += "0";
}
s += to_string((i + 1));
reverse(s.begin(), s.end());
send(get(s));
}
}
#include "decoder.h"
#include "decoderlib.h"
#include "bits/stdc++.h"
using namespace std;
int get1(string s){
stringstream ss;
ss << s;
int x;
ss >> x;
return x;
}
void decode(int N, int L, int X[])
{
vector<int> ans(L);
for(int i = 0; i < L; ++i){
int x = X[i];
string s = to_string(x);
string ss;
ss += s[0];
int idx = get1(ss) - 1;
ss = "";
ss += s[1];
ss += s[2];
ss += s[3];
ans[idx] = get1(ss) - 1;
}
for(int i = 0; i < L; ++i){
output(ans[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... |