| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1297933 | alexiah | Parrots (IOI11_parrots) | C++20 | 0 ms | 0 KiB |
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void encode(int n, int m[])
{
vector<string> enc(n+1);
for(int i = 1; i <= n; i++){
enc[i].push_back(i); enc[i].push_back(0); enc.push_back(0); enc[i].push_back(m[i]);
}
for(int i = 1; i <= n; i++){
int x = stoi(enc[i]);
send(x);
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int n, int l, int X[])
{
vector<int> ans;
vector<int> aux = X;
sort(aux.begin() , aux.end());
for(int i = 0; i < l; i++){
string act = to_string(X[i]);
for(int i = 0; i < act.size(); i++){
if(act[i] == 0){
string ns;
for(int j = i+2; j < act.size(); j++){
ns.push_back(act[j]);
}
int v = stoi(ns);
ans.push_back(v);
break;
}
}
}
for(auto x : ans){
output(x);
}
return;
}
