Submission #16650

# Submission time Handle Problem Language Result Execution time Memory
16650 2015-09-03T01:40:38 Z eaststar Cave (IOI13_cave) C++14
0 / 100
48 ms 464 KB
#include "cave.h"
int a[5010],b[5010],chk[5010];
void exploreCave(int n){
  int i,j,s,e,m,t,p;
  for(i=0;i<n;++i){
    t=tryCombination(a);
    s=0,e=n-1;
    while(s<e){
      m=(s+e)/2;
      for(j=s;j<=m;++j)if(!chk[j])a[j]=!a[j];
      (p==i)^(t=tryCombination(a)==i)?s=m+1:e=m;
    }
    a[s]=!a[s],b[s]=i,chk[s]=1;
  }
  answer(a,b);
}
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 384 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 48 ms 464 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 384 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 452 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 384 KB Answer is wrong
2 Halted 0 ms 0 KB -