#include <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long
#define ld long double
#define vi vector<ll>
#define si set<ll>
#define pqi priority_queue<ll>
#define pb push_back
#define watch(x) cerr << "\n" << (#x) << " is " << (x) << "\n"
#define pbds tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ht cc_hash_table<ll, ll, hash<ll>>;
void encode(int N, int M[]){
    int C = 0;
    send(C);
    for (int i = 0; i < N; ++i)
    {
        M[i]++;
        string s = "";
        while(M[i]){
            if (M[i]%2)
            {
                s+="1";
            }
            else{
                s+="0";
            }
            M[i]/=2;
        }
        reverse(s.begin(), s.end());
        // cout << s << " ";
        for (auto x: s){
            if(x=='1'){
                C++;
            }
            send(C);
        }
        C+=2;
    }
    return;
}
#include <bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long
#define ld long double
#define vi vector<ll>
#define si set<ll>
#define pqi priority_queue<ll>
#define pb push_back
#define watch(x) cerr << "\n" << (#x) << " is " << (x) << "\n"
#define pbds tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ht cc_hash_table<ll, ll, hash<ll>>;
void decode(int N, int L, int X[]){
    sort(X, X+L);
    string s = "";
    for (int i = 1; i < L; ++i)
    {
        if (X[i]==X[i-1])
        {
            s += "0";
        }
        else if(X[i]==X[i-1]+1){
            s += "1";
        }
        else{
            int C = std::stoi(s, nullptr, 2);
            output(C-1);
            s = "";
            if (X[i]==X[i-1]+2)
            {
                s = "0";
            }
            else{
                s = "1";
            }
        }
    }
    int C = std::stoi(s, nullptr, 2);
    output(C-1);
    return;
}
| # | 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... |