| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 849908 | Andrey | Parrots (IOI11_parrots) | C++14 | 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 "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void encode(int n, int m[])
{
    vector<int> bruh(0);
    for(int i = 0; i < n; i++) {
        for(int j = 7; j >= 0; j--) {
            if((1 << j)&m[i]) {
                bruh.push_back(1);
            }
            else {
                bruh.push_back(0);
            }
        }
    }
    int br = 0;
    for(int i = 0; i < bruh.size(); i++) {
        if(bruh[i] == 0 && br < 256) {
            send(br);
        }
        else {
            br++;
        }
    }
}
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
void decode(int n, int l, int x[])
{
    vector<int> br(256);
    for(int i = 0; i < l; i++) {
        br[x[i]]++;
    }
    vector<int> bruh(0);
    for(int i = 0; i < 256; i++) {
        for(int j = 0; j < br[i]; j++) {
            bruh.push_back(0);
        }
        bruh.push_back(1);
    }
    for(int i = 0; i < 10000; i++) {
        bruh.push_back(0);
    }
    int sb = 0;
    for(int i = 0; i < n; i++) {
        sb = 0;
        for(int j = i*8; j < (i+1)*8; j++) {
            sb*=2;
            sb+=bruh[j];
        }
        output(sb);
    }
}
