이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <queue>
#include "encoder.h"
#include "encoderlib.h"
using namespace std;
#define INF 1145141919
#define rep(i, n) for (int i=0; i<(n); i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define _1 first
#define _2 second
typedef pair<int, int> P;
const int B = 0b10101010;
void encode(int N, int A[]) {
if (N <= 32) {
rep(i, N) rep(j, 8) if ((A[i]>>j)&1) send((i<<3) | j);
}
else {
rep(i, N) A[i] ^= B;
rep(i, N) rep(j, 4) rep(_, (A[i]>>(2*j))&0b11) send((i<<2) | j);
}
}
#include <iostream>
#include <vector>
#include <queue>
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
#define INF 1145141919
#define rep(i, n) for (int i=0; i<(n); i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define _1 first
#define _2 second
typedef pair<int, int> P;
const int B = 0b10101010;
int A[64];
int C[256];
void decode(int N, int L, int X[]) {
//rep(i, N) rep(j, 4) rep(_, (A[i]>>(2*j))&0b11) send((i<<2) | j);
rep(i, 256) C[i] = 0;
rep(i, L) C[X[i]]++;
rep(i, N) A[i] = 0;
if (N <= 32) {
rep(i, 256) {
int j = i&0b111;
int pos = i>>3;
A[pos] |= C[i]<<j;
}
}
else {
rep(i, 256) {
int j = i&0b11;
int pos = i>>2;
A[pos] |= C[i]<<(2*j);
}
rep(i, N) A[i] ^= B;
}
rep(i, N) output(A[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... |