# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101945 | Plurm | Cave (IOI13_cave) | C++11 | 833 ms | 492 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cave.h"
#include <cstring>
void exploreCave(int N) {
int arr[N];
memset(arr,0,sizeof(arr));
int forced[N];
memset(forced,-1,sizeof(forced));
int conn[N];
int now[N];
for(int i = 0; i < N; i++){
if(tryCombination(arr) > i-1){
int lo = 0;
int hi = N-1;
int mid;
while(lo < hi){
mid = (lo + hi)/2;
for(int j = 0; j <= mid; j++){
now[j] = !arr[j];
if(forced[j] != -1) now[j] = forced[j];
}
for(int j = mid+1; j <= N; j++){
now[j] = arr[j];
if(forced[j] != -1) now[j] = forced[j];
}
if(tryCombination(arr) == i-1){
hi = mid;
}else{
lo = mid+1;
}
}
Compilation message (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... |