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"
using namespace std;
#define pb push_back
void send(int a);
void encode(int n, int m[])
{
int nb = 0;
for(int i = 0; i<n; i++)
{
string s = bitset<8>(m[i]).to_string();
for(int j = 7; j>=0; j--)
{
if(s[j]=='1')
{
send(nb);
}
nb++;
}
}
}
#include "bits/stdc++.h"
#include "decoder.h"
using namespace std;
#define pb push_back
void output(int b);
void decode(int n, int l, int x[])
{
sort(x, x+l);
int ptr = 0;
for(int i = 0; i<n; i++)
{
int nb = 0;
for(int j = 0; j<8; j++)
{
if(binary_search(x, x+l, ptr))
{
int temp = 1;
for(int k = 0; k<j; k++)
temp*=2;
nb+=temp;
}
ptr++;
}
output(nb);
}
}
# | 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... |