| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1338017 | lex._. | Cave (IOI13_cave) | C++20 | 263 ms | 492 KiB |
#include "cave.h"
#define NMAX 5000
#define LOG 13
int s[NMAX], d[NMAX];
bool is_set[NMAX];
void set_bit(int st, int dr, int bit)
{
for(int i=st; i<=dr; i++)
{
if(is_set[i]==0)
s[i]=bit;
}
}
void exploreCave(int N)
{
for(int i=0; i<N; i++) d[i]=-1;
for(int i=0; i<N; i++)
{
set_bit(0, N-1, 1);
int door=tryCombination(s);
bool bit_open;
bit_open=(door!=i);
set_bit(0, N-1, !bit_open);
int pos=0;
for(int e=LOG-1; e>=0; e--)
{
if(pos+(1<<e)<=N)
{
set_bit(pos, pos+(1<<e)-1, bit_open);
int new_door=tryCombination(s);
if(new_door==i) pos+=(1<<e);
else set_bit(pos, pos+(1<<e)-1, !bit_open);
}
}
d[pos]=i;
is_set[pos]=1;
s[pos]=bit_open;
}
answer(s, d);
}
| # | 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... | ||||
