# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
306409 |
2020-09-25T13:10:25 Z |
amunduzbaev |
Cave (IOI13_cave) |
C++14 |
|
27 ms |
512 KB |
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
int s[5005],d[5005],ret;
bool used[5005],prevdopen,dopen;
void exploreCave(int n) {
memset(s,0,sizeof(s));
for(int i=0;i<n-1;i++){
if(ret==-1||ret>i)
prevdopen=1;
else
prevdopen=0;
int l=0,r=n-1;
while(l<r){
int m=(l+r)/2;
for(int i=l;i<=m;i++){
if(used[i])
continue;
s[i]=!s[i];
}
ret=tryCombination(s);
if(ret==-1||ret>i)
dopen=1;
else
dopen=0;
if(dopen==prevdopen)
l=m+1;
else
r=m;
prevdopen=dopen;
}
d[l]=i;
used[i]=1;
if(!dopen){
s[l]=!s[l];
ret=tryCombination(s);
}
}
answer(s,d);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
19 ms |
512 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
27 ms |
384 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
19 ms |
512 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |