# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
799250 | Liudas | Parrots (IOI11_parrots) | C++17 | 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 <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
/*
int ord[100000] = {0}, seq[1000000] = {0};
int p = 0, pp = 0;
void send(int x){
ord[p++] = x;
}
void output(int x){
seq[pp++] = x;
}
*/
void encode(int N, int M[]){
for(int i = 0; i < N; i ++){
send(1000 * i + M[i]);
}
}
void decode(int N, int L, int X[]){
map<int, int> arr;
for(int i = 0; i < L; i++){
arr[X[i]]++;
}
for(int i = 0; i < N; i ++){
for(auto [l, r] : arr){
if(l / 1000 == i){
output(l % 1000);
break;
}
}
}
}
#include <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
/*
int ord[100000] = {0}, seq[1000000] = {0};
int p = 0, pp = 0;
void send(int x){
ord[p++] = x;
}
void output(int x){
seq[pp++] = x;
}
*/
void encode(int N, int M[]){
for(int i = 0; i < N; i ++){
send(1000 * i + M[i]);
}
}
void decode(int N, int L, int X[]){
map<int, int> arr;
for(int i = 0; i < L; i++){
arr[X[i]]++;
}
for(int i = 0; i < N; i ++){
for(auto [l, r] : arr){
if(l / 1000 == i){
output(l % 1000);
break;
}
}
}
}