Submission #523677

#TimeUsernameProblemLanguageResultExecution timeMemory
523677bebecanvasCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
void exploreCave(int N) { int s[N]; int d[N]; for(int i=0; i<N; i++){d[i]=-1;} for(int i=0; i<N; i++){ int l=0; int r=N-1; int test[N]; for(int i=0; i<N; i++){test[i]=0;} for(int i=0; i<N; i++){if(d[i]!=-1){test[i]= s[i];}} int lol= tryCombination(test); while(l<=r){ int mid= l+(r-l)/2; for(int j=mid; j<=r; j++){if(d[j]==-1){test[j]+= 1; test[j]%=2;}} int loll= tryCombination(test); if(lol==i){ if(loll>lol){ l= mid; }else{ r= mid-1; } }else{ if(loll==i){ l= mid; }else{ r= mid-1; } } } d[l]=i; if(lol==i){s[l]=1;}else{s[l]=0;} } answer(s, d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:13:12: error: 'tryCombination' was not declared in this scope
   13 |   int lol= tryCombination(test);
      |            ^~~~~~~~~~~~~~
cave.cpp:37:5: error: 'answer' was not declared in this scope
   37 |     answer(s, d);
      |     ^~~~~~