Submission #228052

#TimeUsernameProblemLanguageResultExecution timeMemory
228052tushar_2658Parrots (IOI11_parrots)C++14
17 / 100
11 ms1536 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...