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>
#define mp make_pair
#define fs first
#define sc second
#define pb push_back
#define debug(x) cout<<#x<<" = "<<(x)<<endl
#define mod 998244353
#define INF 1e18
#include "encoder.h"
#include "encoderlib.h"
using namespace std;
void encode(int N, int M[]){
for(int i = 0; i < N; i++){
for(int j = 0; j < 8; j++){
int now = (1 << j);
int idx = 8 * i + j;
if(i >= 32){
idx = 8 * (i - 32) + j;
}
if((now & M[i]) > 0){
if(i < 32){
send(idx);
}else{
send(idx);
send(idx);
}
}
}
}
}
#include<bits/stdc++.h>
#define mp make_pair
#define fs first
#define sc second
#define pb push_back
#define debug(x) cout<<#x<<" = "<<(x)<<endl
#define mod 998244353
#define INF 1e18
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
void decode(int N, int L, int X[]){
int ans[65];
int nyak[300];
memset(ans, 0, sizeof(ans));
memset(nyak, 0, sizeof(nyak));
for(int i = 0; i < L; i++){
nyak[X[i]]++;
}
for(int i = 0; i < 256; i++){
if(nyak[i] == 0){
continue;
}else if(nyak[i] == 1){
int pos = i / 8;
int idx = i % 8;
ans[pos] = ans[pos] + (1 << idx);
}else if(nyak[i] == 2){
int pos = (i / 8) + 32;
int idx = i % 8;
ans[pos] = ans[pos] + (1 << idx);
}else{
int pos = i / 8;
int idx = i % 8;
ans[pos] = ans[pos] + (1 << idx);
pos = (i / 8) + 32;
idx = i % 8;
ans[pos] = ans[pos] + (1 << idx);
}
}
for(int i = 0; i < N; i++){
output(ans[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... |