#include "encoder.h"
#include "encoderlib.h"
#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(), x.end()
#define pii pair<int,int>
#define pb push_back
void encode(int N, int M[])
{
int i;
for(i = 0; i < N; i++){
int x = M[i], bi = 0;
vector<int> bin;
int d = x;
while(d){
bin.pb(d % 4);
d /= 4;
}
for(int r: bin){
int mao = i;
mao |= (r << 6);
mao |= (bi<< 4);
bi++;
send(mao);
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(), x.end()
#define pii pair<int,int>
#define pb push_back
void decode(int N, int L, int X[])
{
int fin[N]; memset(fin,0,sizeof(fin));
for(int i = 0; i < L; i++){
int r = X[i];
int ind = (1<<4) - 1;
ind &= r;
r >>= 4;
int bin = (1<<2) - 1;
bin &= r;
r >>= 2;
bin *= 2;
if(r) fin[ind] |= (r<<bin);
}
for(int r: fin) output(r);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
1040 KB |
Output is correct |
2 |
Correct |
2 ms |
1032 KB |
Output is correct |
3 |
Correct |
3 ms |
1036 KB |
Output is correct |
4 |
Correct |
2 ms |
1036 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1028 KB |
Output is correct |
2 |
Correct |
2 ms |
1040 KB |
Output is correct |
3 |
Correct |
2 ms |
1044 KB |
Output is correct |
4 |
Correct |
2 ms |
1040 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
1024 KB |
Output is correct |
2 |
Correct |
1 ms |
1036 KB |
Output is correct |
3 |
Incorrect |
1 ms |
1044 KB |
Error : Output is wrong |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1044 KB |
Output is correct - P = 4.000000 |
2 |
Incorrect |
3 ms |
1048 KB |
Error : Output is wrong |
3 |
Incorrect |
3 ms |
1048 KB |
Error : Output is wrong |
4 |
Incorrect |
3 ms |
1072 KB |
Error : Output is wrong |
5 |
Incorrect |
5 ms |
1080 KB |
Error : Output is wrong |
6 |
Incorrect |
4 ms |
1080 KB |
Error : Output is wrong |
7 |
Incorrect |
4 ms |
1080 KB |
Error : Output is wrong |