#include "encoder.h"
#include "encoderlib.h"
void encode(int N, int M[]){
int i,j,tt;
int tmp[100];
if(N <= 32){
for(i=0; i<N; i++) tmp[i] = M[i];
for(i=0; i<N; i++){
j = -1;
while(M[i] != 0){
tt = M[i] % 2;
M[i] /= 2;
j++;
if(tt == 0) continue;
send(8*i+j);
}
}
for(i=0; i<N; i++) M[i] = tmp[i];
return;
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <algorithm>
#include <stdio.h>
using namespace std;
int ans[100];
void decode(int N, int L, int X[]){
int i;
int t1,t2;
if(N <= 32){
for(i=0; i<N; i++) ans[i] = 0;
for(i=0; i<L; i++){
t1 = X[i] / 8;
t2 = X[i] % 8;
ans[t1] += (1 << t2);
}
for(i=0; i<N; i++){
output(ans[i]);
}
return;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
752 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1848 KB |
Output is correct |
2 |
Correct |
7 ms |
1848 KB |
Output is correct |
3 |
Correct |
5 ms |
1848 KB |
Output is correct |
4 |
Correct |
5 ms |
1848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
2056 KB |
Output is correct |
2 |
Correct |
5 ms |
2056 KB |
Output is correct |
3 |
Correct |
5 ms |
2176 KB |
Output is correct |
4 |
Correct |
6 ms |
2176 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
2176 KB |
Output is correct |
2 |
Correct |
5 ms |
2176 KB |
Output is correct |
3 |
Correct |
6 ms |
2176 KB |
Output is correct |
4 |
Correct |
7 ms |
2176 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2176 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
5 ms |
2176 KB |
Output is partially correct - P = 8.000000 |
2 |
Partially correct |
8 ms |
2176 KB |
Output is partially correct - P = 8.000000 |
3 |
Incorrect |
5 ms |
2176 KB |
Error : Output length must be N |
4 |
Incorrect |
5 ms |
2176 KB |
Error : Output length must be N |
5 |
Incorrect |
4 ms |
2176 KB |
Error : Output length must be N |
6 |
Incorrect |
4 ms |
2176 KB |
Error : Output length must be N |
7 |
Incorrect |
5 ms |
2176 KB |
Error : Output length must be N |