#include "encoder.h"
#include "encoderlib.h"
#include<bits/stdc++.h>
using namespace std;
void encode(int N, int M[])
{
int id = 0;
for(int i=0; i<N; i++){
for(int j = 0; j<8; j++){
//cout<<M[i]<<" "<<bitset<8>(M[i] & (1<<j))<<endl;
int v= ((id<<1)|((M[i] & (1<<j))>>j));
//cout<<bitset<8>(v)<<endl;
send(v);
id++;
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include<bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[])
{
vector<int> v(L);
for(int i = 0; i<L; i++){
v[i] = X[i];
}
sort(v.begin(), v.end());
//cout<<"decoding"<<endl;
for(int i = 0; i<N; i++){
int res= 0;
for(int j = 0; j<8; j++){
//cout<<bitset<8>((v[i*8 + j]&1)<<j)<<endl;
res += ((v[i*8 + j]&1)<<j);
}
output(res);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
784 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
1308 KB |
Output is correct |
2 |
Correct |
1 ms |
1320 KB |
Output is correct |
3 |
Correct |
2 ms |
1316 KB |
Output is correct |
4 |
Correct |
3 ms |
1324 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1312 KB |
Output is correct |
2 |
Correct |
2 ms |
1328 KB |
Output is correct |
3 |
Correct |
2 ms |
1320 KB |
Output is correct |
4 |
Correct |
2 ms |
1336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1332 KB |
Output is correct |
2 |
Correct |
2 ms |
1328 KB |
Output is correct |
3 |
Incorrect |
1 ms |
800 KB |
Error : Bad encoded integer |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
3 ms |
1328 KB |
Output is partially correct - P = 8.000000 |
2 |
Incorrect |
0 ms |
792 KB |
Error : Bad encoded integer |
3 |
Incorrect |
2 ms |
804 KB |
Error : Bad encoded integer |
4 |
Incorrect |
1 ms |
808 KB |
Error : Bad encoded integer |
5 |
Incorrect |
1 ms |
808 KB |
Error : Bad encoded integer |
6 |
Incorrect |
1 ms |
796 KB |
Error : Bad encoded integer |
7 |
Incorrect |
1 ms |
796 KB |
Error : Bad encoded integer |