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;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
static int N, *M;
void encode(int _N, int *_M)
{
int i, j;
N=_N; M=_M;
for(i=0; i<N; i++)
{
for(j=0; j<8; j++)
{
if(M[i]&(1<<j))
{
send(i*8+j);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 64;
static int N, L, *X;
static int ans[MAXN+10];
void decode(int _N, int _L, int *_X)
{
int i, j;
N=_N; L=_L; X=_X;
for(i=0; i<N; i++) ans[i]=0;
for(i=0; i<L; i++)
{
ans[X[i]/8]+=(1<<(X[i]%8));
}
for(i=0; i<N; i++)
{
output(ans[i]);
}
}
Compilation message (stderr)
decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:17:12: warning: unused variable 'j' [-Wunused-variable]
int i, j;
^
# | 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... |