제출 #380667

#제출 시각아이디문제언어결과실행 시간메모리
380667ritul_kr_singh동굴 (IOI13_cave)C++17
0 / 100
643 ms492 KiB
#include "cave.h" void exploreCave(int N){ int ans[N], curr[N], D[N]; for(int &i : ans) i = -1; for(int i=0; i<N; ++i){ for(int j=0; j<N; ++j) curr[i] = ans[i]>=0 ? ans[i] : 1; int currRes = tryCombination(curr); bool one = currRes>=i or currRes<0; int low = 0, high = N-1; while(low<high){ int mid = (low+high)/2; for(int j=0; j<N; ++j) curr[i] = ans[i]>=0 ? ans[i] : ((int)(j<=mid)+(int)!one)%2; currRes = tryCombination(curr); if(currRes>=i or currRes<0) high = mid; else low = mid+1; } ans[low] = one; D[low] = i; } answer(ans, 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...