| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 649916 | Pablo_No | 동굴 (IOI13_cave) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
const int N = 5005;
const int B = 13;
int q[N];
int cpos[N];
int ord[N];
void exploreCave(int N) {
for(int i = 0; i < N; i++)
{
cpos[i] = -1;
}
for(int i = 0; i < N; i++)
{
for(int j = 0; j < N; j++)
{
q[j] = 0;
if(cpos[j] != -1)
q[j] = cpos[j];
}
int an = tryCombination(q);
cpos[i] = 1;
if(an > i)
cpos[i] = 0;
int cp = cpos[i];
int idx = 0;
for(int k = 0; k < B; k++)
{
for(int j = 0; j < N; j++)
{
q[j] = 1-cp;
if(cpos[j] != -1)
q[j] = cpos[j];
else if((j & (1 << k)) && ((j | ((1 << k)-1)) == idx))
q[i] = cp;
}
int anx = tryCombination(q);
if(anx > i)
idx += (1 << k);
}
ord[i] = idx;
}
answer(cpos, ord);
}
