제출 #981442

#제출 시각아이디문제언어결과실행 시간메모리
981442batsukh2006동굴 (IOI13_cave)C++17
0 / 100
231 ms536 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int N){ int pos[N],ans[N]; vector<bool> vis(N); memset(pos,0,sizeof(pos)); for(int i=0; i<N; i++){ int tmp=0,p=0; if(tryCombination(pos)==i) tmp=1; int l=0,r=N-1; while(l<=r){ int m=l+(r-l)/2; for(int z=0; z<=m; z++){ if(!vis[z]) pos[z]^=1; } if(tmp){ if(tryCombination(pos)==i) l=m+1,p=pos[m]^1; else r=m-1,p=pos[m]; }else{ if(tryCombination(pos)==i) r=m-1,p=pos[m]^1; else l=m+1,p=pos[m]; } } l--; vis[l]=1; ans[l]=i; pos[l]=p; } answer(pos,ans); }
#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...