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"
#define lp(i,a,b) for(int i=a;i<b;i++)
#define MAX 70
using namespace std;
int qtd[8] = {1,2,1,2,1,2,1,2} ;
void encode(int n , int m[] )
{
if(n <= 32 )
lp(i,0,8) qtd[i] = 1 ;
lp(i,0,n)
lp(j,0,8)
if( (m[i] & (1<<j) ) != 0 )
lp(k,0,qtd[j]) send(8*i+j-j%2) ;
}
#include <bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
#define lp(i,a,b) for(int i=a;i<b;i++)
#define MAX 70
using namespace std;
void decode(int n , int l , int x[])
{
int seq[MAX] ;
lp(i,0,n) seq[i] = 0 ;
lp(i,0,l)
seq[ x[i]/8 ] += (1<<(x[i]%8)) ;
lp(i,0,n) output(seq[i]) ;
}
# | 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... |