# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
228057 | tushar_2658 | Parrots (IOI11_parrots) | C++14 | 12 ms | 1536 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 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;
if(i < 9){
s += "2";
}
s += to_string((i + 1));
s += to_string(x);
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;
if(s[0] != '2'){
ss += s[0];
}
ss += s[1];
int idx = get1(ss) - 1;
ss = "";
int id = 2;
while(id < s.size()){
ss += s[id];
++id;
}
ans[idx] = get1(ss) - 1;
}
for(int i = 0; i < L; ++i){
output(ans[i]);
}
}
Compilation message (stderr)
# | 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... |