| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 935202 | KebabuVaikis15 | 앵무새 (IOI11_parrots) | C++14 | 7 ms | 2468 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
static map<int, bool> lank;
static map<int, pair<int, int>> perm;
static int b[7];
static int iSkaiciu()
{
int s=0;
for (int i=0; i<7; i++)
s+=b[i]<<(2*i);
return s;
}
static void pildyti(int L)
{
int val=iSkaiciu();
if (lank.count(val))
return;
lank[val]=1;
perm[perm.size()]={L, val};
for (int i=0; i<L; i++)
if ((i==L-1 && b[i]<3) || (i<L-1 && b[i]<b[i+1]))
{
b[i]++;
pildyti(L);
b[i]--;
}
}
void encode(int N, int M[])
{
for (int i=0; i<=7; i++)
{
pildyti(i);
lank.clear();
}
for (int i=0; i<N; i++)
for (int j=0; j<perm[M[i]].first; j++)
{
send((i<<2)+((perm[M[i]].second>>(2*j))&3));
// cout<<((i<<2)+((perm[M[i]].second>>(2*j))&3))<<endl;
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
static map<int, bool> lank2;
static map<pair<int, int>, int> perm2;
static int b[7];
static int iSkaiciu()
{
int s=0;
for (int i=0; i<7; i++)
s+=b[i]<<(2*i);
return s;
}
static void pildyti(int L)
{
int val=iSkaiciu();
if (lank2.count(val))
return;
lank2[val]=1;
perm2[{L, val}]=perm2.size();
for (int i=0; i<L; i++)
if ((i==L-1 && b[i]<3) || (i<L-1 && b[i]<b[i+1]))
{
b[i]++;
pildyti(L);
b[i]--;
}
}
void decode(int N, int L, int X[])
{
vector<int> B[N];
for (int i=0; i<=7; i++)
{
pildyti(i);
lank2.clear();
}
for (int i=0; i<L; i++)
B[X[i]>>2].push_back(X[i]&3);
for (int i=0; i<N; i++)
{
sort(B[i].begin(), B[i].end());
int s=0;
for (int j=0; j<B[i].size(); j++)
s+=B[i][j]<<(2*j);
output(perm2[{B[i].size(), s}]);
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
