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;
#define lli long long int
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define repa(i,a,b) for(int i = (a); i >= (b); i--)
#define debug(a) cout << #a << " = " << a << endl
#define debugsl(a) cout << #a << " = " << a << ", "
void encode(int N, int M[])
{
lli n,num,sum,a,b;
n = N;
sum = 0;
/*rep(i,0,n-1);
num = M[i];
a = sum;
while (a > 0) {
if (a&1) sum++;
a/=2;
}
}*/
rep(i,0,n-1) {
num = M[i];
a = num << 2;
rep(j,0,3) {
b = (num&3);
rep(x,1,b) send(a+j);
num>>=2;
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define repa(i,a,b) for(int i = (a); i >= (b); i--)
#define debug(a) cout << #a << " = " << a << endl
#define debugsl(a) cout << #a << " = " << a << ", "
void decode(int N, int L, int X[])
{
lli num[70][4],n,a,b,pos;
n = N;
rep(i,0,L-1) {
a = X[i];
pos = a>>2;
b = (a&3);
num[pos][b]++;
}
rep(i,0,n-1) {
a = 0;
a += num[i][0];
a += num[i][1] * 4;
a += num[i][2] * 16;
a += num[i][3] * 64;
output(a);
}
}
Compilation message (stderr)
encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:13:15: warning: variable 'sum' set but not used [-Wunused-but-set-variable]
13 | lli n,num,sum,a,b;
| ^~~
# | 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... |