| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1348281 | miyazaki1072 | Cave (IOI13_cave) | C++20 | 1 ms | 344 KiB |
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int N) {
int ans[N],door[N],temp[N];
memset(ans,-1,sizeof ans);
int K = 31-__builtin_clz(N);
for(int i =0;i<N;i++){
int idx = 0;
bool ch = 1;
//open i door
for(int j=0;j<N;j++){
if(ans[j]!=-1)temp[j]=ans[j];
else temp[j] = !ch;
}
if(tryCombination(temp)!=i)ch=!ch;
for(int p=0;p<K;p++){
for(int j=0;j<N;j++){
if(ans[j]==-1){
if(j&(1<<p))temp[j]=ch;
else temp[j] = !ch;
}
else temp[j] = ans[j];
if(tryCombination(temp) !=i)idx|=(1<<p);
}
ans[idx]=ch;
door[idx]=i;
}
}
answer(ans,door);
}
| # | 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... | ||||
