제출 #648714

#제출 시각아이디문제언어결과실행 시간메모리
648714tigar동굴 (IOI13_cave)C++14
0 / 100
439 ms408 KiB
#include "cave.h" #include <bits/stdc++.h> void exploreCave(int N) { int combos[2][N]; int door[N]; bool check[N]; for(int i=0; i<N; i++){combos[0][i]=0; combos[1][i]=1; check[i]=false;} for(int i=0; i<N; i++) { int bol=1; int xx=tryCombination(combos[0]); if(xx>i or xx==-1)bol=0; int l=0, r=N, midd=N/2; while(l<=r) { for(int j=0; j<N; j++) { if((j>=midd or j<l) and !check[j])combos[bol][j]=abs(bol-1); else if((j<midd and j>=l) and !check[j])combos[bol][j]=bol; } int br=tryCombination(combos[bol]); if(l==r){check[l]=true; combos[0][l]=bol; combos[1][l]=bol; door[l]=i; break;} else if(br>i or br==-1){r=midd-1; midd=(l+r)/2;} else {l=midd; midd=(l+r)/2;} } } return answer(combos[0], door); }
#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...