이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define lol long long
#define pii pair<int,int>
#define OK puts("OK");
#define NO puts("NO");
#define YES puts("YES");
#define fr first
#define sc second
#define ret return
#define scanl(a) scanf("%lld",&a);
#define scanll(a,b) scanf("%lld %lld",&a, &b);
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define scan1(a) scanf("%d",&a);
#define scan2(a,b) scanf("%d %d",&a, &b);
#define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define allr(s) s.rbegin(),s.rend()
#define pb push_back
#define sz(v) (int)v.size()
#define endi puts("");
#define eps 1e-12
void encode(int N, int M[]){
int i,j,xr=0;
for (i=0;i<8;++i){
int a=0,b=0;
for (j=0;j<N;++j){
if ((M[j]&(1<<i)))a++;
else b++;
}
if (a > b)xr|=(1<<i);
}
send(xr);
send(xr);
send(xr);
send(xr);
for(i=0; i<N; i++){
int x = (i<<8);
int m = M[i];
m ^= xr;
{
bool a = m&1;
m = (m>>1);
bool b = m&1;
m = (m>>1);
if (a == 1 && b == 0){
send(x);
}
else if (a == 0 && b == 1){
send(x);
send(x);
}
else if (a == 1 && b == 1){
send(x);
send(x);
send(x);
}
}
x++;
{
bool a = m&1;
m = (m>>1);
bool b = m&1;
m = (m>>1);
if (a == 1 && b == 0){
send(x);
}
else if (a == 0 && b == 1){
send(x);
send(x);
}
else if (a == 1 && b == 1){
send(x);
send(x);
send(x);
}
}
x++;
{
bool a = m&1;
m = (m>>1);
bool b = m&1;
m = (m>>1);
if (a == 1 && b == 0){
send(x);
}
else if (a == 0 && b == 1){
send(x);
send(x);
}
else if (a == 1 && b == 1){
send(x);
send(x);
send(x);
}
}
x++;
{
bool a = m&1;
m = (m>>1);
bool b = m&1;
m = (m>>1);
if (a == 1 && b == 0){
send(x);
}
else if (a == 0 && b == 1){
send(x);
send(x);
}
else if (a == 1 && b == 1){
send(x);
send(x);
send(x);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define lol long long
#define pii pair<int,int>
#define OK puts("OK");
#define NO puts("NO");
#define YES puts("YES");
#define fr first
#define sc second
#define ret return
#define scanl(a) scanf("%lld",&a);
#define scanll(a,b) scanf("%lld %lld",&a, &b);
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define scan1(a) scanf("%d",&a);
#define scan2(a,b) scanf("%d %d",&a, &b);
#define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define allr(s) s.rbegin(),s.rend()
#define pb push_back
#define sz(v) (int)v.size()
#define endi puts("");
#define eps 1e-12
int cnt[256],ans[256];
void decode(int N, int L, int X[]){
int i,xr=0;
for (i=0;i<L;++i)
cnt[X[i]]++;
for (i=0;i<L;++i){
if (cnt[X[i]] >= 4){
xr = X[i];
cnt[X[i]]-=4;
break;
}
}
for (i=0;i<L;++i){
if (!cnt[X[i]])continue;
cnt[X[i]]--;
ans[X[i]>>2] += (1<<((X[i]&3)*2));
}
for (i=0;i<N;++i){
ans[i] ^= xr;
}
for (i=0;i<N;++i)output(ans[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... |