#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void encode(int n, int m[])
{
for (int i = 0; i < n; ++i)
{
for (int bit = 0; bit < 8; ++bit)
{
if ((m[i] & (1 << bit)) != 0)
{
send(i * 8 + bit);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int n, int l, int x[])
{
int ans[n] = {};
for (int i = 0; i < l; ++i)
{
int pos = x[i] / 8;
int bit = x[i] % 8;
ans[pos] += (1 << bit);
}
for (int i = 0; i < n; ++i)
{
output(ans[i]);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
780 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1620 KB |
Output is correct |
2 |
Correct |
3 ms |
1312 KB |
Output is correct |
3 |
Correct |
1 ms |
1316 KB |
Output is correct |
4 |
Correct |
1 ms |
1316 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1308 KB |
Output is correct |
2 |
Correct |
1 ms |
1312 KB |
Output is correct |
3 |
Correct |
1 ms |
1300 KB |
Output is correct |
4 |
Correct |
1 ms |
1308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1308 KB |
Output is correct |
2 |
Correct |
2 ms |
1312 KB |
Output is correct |
3 |
Correct |
2 ms |
1320 KB |
Output is correct |
4 |
Correct |
2 ms |
1328 KB |
Output is correct |
5 |
Correct |
3 ms |
1320 KB |
Output is correct |
6 |
Correct |
2 ms |
1324 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
1316 KB |
Output is partially correct - P = 8.000000 |
2 |
Partially correct |
3 ms |
1328 KB |
Output is partially correct - P = 8.000000 |
3 |
Incorrect |
0 ms |
784 KB |
Error : Bad encoded integer |
4 |
Incorrect |
0 ms |
792 KB |
Error : Bad encoded integer |
5 |
Incorrect |
1 ms |
792 KB |
Error : Bad encoded integer |
6 |
Incorrect |
0 ms |
788 KB |
Error : Bad encoded integer |
7 |
Incorrect |
0 ms |
780 KB |
Error : Bad encoded integer |