Submission #523678

#TimeUsernameProblemLanguageResultExecution timeMemory
523678bebecanvas동굴 (IOI13_cave)C++14
0 / 100
2 ms424 KiB
#include "cave.h" 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); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...