#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#include "encoder.h"
#include "encoderlib.h"
//#include "parrotslib.h"
using namespace std;
const int MN = 3e5 + 5;
int xx[300005];
int vl[45][15];
int get(int b,int idx){
return vl[idx][b];
// return idx * 10 + b;
}
void fill(){
int p = 0;
for (int i=0;i<32;i++){
for (int j=0;j<8;j++){
vl[i][j] = p++;
}
}
}
void encode(int N, int M[]){
fill();
int id = -1;
for (int i = 0; i < N; i++){
int x = M[i];
for (int j = 7; j >= 0; j--){
if (((x >> j) & 1)){
xx[++id] = get(j,i);
}
}
}
for (int i=0;i<=id;i++)
send(xx[i]);
}
#include <bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
#define ll long long
#define pb push_back
//#include "parrotslib.h"
using namespace std;
//const int MN = 3e5 + 5;
int yy[300005],vl2[45][15];
pair <int,int> rev[315];
void fill2(){
int p = 0;
for (int i=0;i<32;i++){
for (int j=0;j<8;j++){
vl2[i][j] = p;
rev[p] = {i,j};
p++;
}
}
}
void decode(int N, int L, int X[]){
fill2();
for (int i=0;i<N;i++)
yy[i] = 0;
for (int i = 0; i < L; i++){
int x = X[i];
int A = rev[x].second,B = rev[x].first;
yy[B] |= (1<<A);
}
for (int i=0;i<N;i++)
output(yy[i]);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2832 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2848 KB |
Output is correct |
2 |
Correct |
1 ms |
2844 KB |
Output is correct |
3 |
Correct |
1 ms |
2844 KB |
Output is correct |
4 |
Correct |
1 ms |
2856 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2832 KB |
Output is correct |
2 |
Correct |
1 ms |
2852 KB |
Output is correct |
3 |
Correct |
1 ms |
2852 KB |
Output is correct |
4 |
Correct |
2 ms |
2856 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2840 KB |
Output is correct |
2 |
Correct |
1 ms |
2856 KB |
Output is correct |
3 |
Correct |
1 ms |
2860 KB |
Output is correct |
4 |
Correct |
2 ms |
3028 KB |
Output is correct |
5 |
Correct |
2 ms |
2876 KB |
Output is correct |
6 |
Correct |
3 ms |
2872 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
2844 KB |
partially correct P=8.000000 |
2 |
Partially correct |
3 ms |
2876 KB |
partially correct P=8.000000 |
3 |
Incorrect |
2 ms |
2880 KB |
Error : Output is wrong |
4 |
Halted |
0 ms |
0 KB |
- |