이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ii = pair<int, int>;
#define pb push_back
#define pp pop_back
#define ff first
#define ss second
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
void encode(int N, int M[]) {
bitset<520> B;
for(int l = 0; l < N; l++) {
int V = M[l];
for(int i = 0; i < 8; i++)
B[l * 8 + i] = (V & (1 << i));
}
for(int l = 0; l < N * 8; l++) {
if(B[l]) {
if(l >= 256)
send(l - 256), send(l - 256);
else send(l);
}
}
}
#include <bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ii = pair<int, int>;
#define pb push_back
#define pp pop_back
#define ff first
#define ss second
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
void decode(int N, int L, int X[]) {
sort(X, X + L);
bitset<520> B; int occ[256];
memset(occ, 0, sizeof occ);
for(int l = 0; l < L; l++) occ[X[l]]++;
for(int l = 0; l < 256; l++) {
if(occ[l] == 1 || occ[l] == 3) B[l] = 1;
if(occ[l] == 2 || occ[l] == 3) B[l + 256] = 1;
}
for(int l = 0; l < N; l++) {
int K = 0;
for(int i = 0; i < 8; i++)
if(B[l * 8 + i]) K += (1 << i);
output(K);
}
}
# | 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... |