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>
#define fi first
#define se second
#define ll long long
#define dl double long
using namespace std;
void encode(int n, int a[])
{
for( int i = 0; i < n; i++ ){
for( int j = 0; j < 3; j++ ){
int x = i;
for( int h = 5; h < 8; h++ ){
if( ( (a[i] >> (min(7 , j * 3 + h - 5))) & 1) ){
if( j * 3 + h - 5 <= 7 )x += (1 << h);
}
}
if( x == i )continue;
for( int g = 1; g <= (1 << j); g++ ){
send( x );
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define dl double long
using namespace std;
void decode(int n, int l, int a[])
{
map < int , int > m;
for( int i = 0; i < l; i++ ){
m[a[i]] += 1;
}
vector < int > ans(n , 0);
for( auto x : m ){
int p = 0;
for( int j = 0; j < 5; j++ ){
if( (x.fi & (1 << j)) )p |= (1 << j);
}
int val = 0;
for( int g = 0; g < 3; g++ ){
if( !(x.se & (1 << g)) )continue;
for( int j = 0; j < 3; j++ ){
if( (( x.fi >> (5 + j) ) & 1) ){
if( g * 3 + j <= 7 )ans[p] |= (1 << (g * 3 + j) );
}
}
}
}
for( int i = 0; i < n; i++ ){
output( ans[i] );
}
}
Compilation message (stderr)
decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:24:13: warning: unused variable 'val' [-Wunused-variable]
int val = 0;
^~~
# | 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... |