This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "encoder.h"
#include "encoderlib.h"
void encode(int N, int M[])
{
// 비트 위치별 마스크
int mask[8] = { 1 << 0, 1 << 1, 1 << 2, 1 << 3,
1 << 4, 1 << 5, 1 << 6, 1 << 7 };
for (int i = 0; i < N; i++){
//전송하고자 하는 메시지
int message = M[i];
//전송메시지의 위치
int loc = i << 3;
//메시지 비트별 위치
for (int m = 0; m < 8; m += 1){
if (message&mask[m]){
send(loc + m);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[]){
int M[64] = { 0 };
for (int i = 0; i < L; i++){
int message = X[i];
int loc = message >> 3;
M[loc] += 1<<((message % 8));
}
for (int i = 0; i < N; i++){
output(M[i]);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |