#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++) {
if (M[i] & (1 << j)) {
// bit i * 8 + j is on
send(i * 8 + j);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
int A[105];
void decode(int N, int L, int X[]) {
for (int i = 0; i < N; i++) {
A[i] = 0;
}
for (int i = 0; i < L; i++) {
int pos = X[i] / 8, bit = X[i] % 8;
A[pos] |= (1 << bit);
}
for (int i = 0; i < N; i++) {
output(A[i]);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
648 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1036 KB |
Output is correct |
2 |
Correct |
1 ms |
1044 KB |
Output is correct |
3 |
Correct |
1 ms |
1040 KB |
Output is correct |
4 |
Correct |
1 ms |
1040 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
900 KB |
Output is correct |
2 |
Correct |
1 ms |
1032 KB |
Output is correct |
3 |
Correct |
1 ms |
1032 KB |
Output is correct |
4 |
Correct |
1 ms |
1036 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
900 KB |
Output is correct |
2 |
Correct |
2 ms |
1048 KB |
Output is correct |
3 |
Correct |
1 ms |
1048 KB |
Output is correct |
4 |
Correct |
2 ms |
1056 KB |
Output is correct |
5 |
Correct |
2 ms |
1064 KB |
Output is correct |
6 |
Correct |
3 ms |
1068 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
1044 KB |
Output is partially correct - P = 8.000000 |
2 |
Partially correct |
3 ms |
1052 KB |
Output is partially correct - P = 8.000000 |
3 |
Incorrect |
0 ms |
520 KB |
Error : Bad encoded integer |
4 |
Incorrect |
0 ms |
512 KB |
Error : Bad encoded integer |
5 |
Incorrect |
0 ms |
512 KB |
Error : Bad encoded integer |
6 |
Incorrect |
0 ms |
512 KB |
Error : Bad encoded integer |
7 |
Incorrect |
0 ms |
512 KB |
Error : Bad encoded integer |