제출 #757583

#제출 시각아이디문제언어결과실행 시간메모리
757583KALARRY동굴 (IOI13_cave)C++14
0 / 100
1 ms340 KiB
//chockolateman #include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int N) { int seq[N]; int ans[N]; for(int i =0 ; i < N ; i++) seq[i] = 0; bool used[N]; for(int i = 0 ; i < N ; i++) used[i] = false; for(int i = 0 ; i < N ; i++) { int res = tryCombination(seq); if(res>i||res==-1) { for(int i = 0 ; i < N ; i++) if(!used[i]) { if(seq[i]) seq[i] = 0; else seq[i] = 1; } } int low = 0; int high = N-1; while(high > low) { int mid = (low+high)/2; for(int i = 0 ; i <= mid; i++) { if(!used[i]) { if(seq[i]) seq[i] = 0; else seq[i] = 1; } } res = tryCombination(seq); if(res>i||res==-1) high = mid; else low = mid; for(int i = 0 ; i <= mid; i++) { if(!used[i]) { if(seq[i]) seq[i] = 0; else seq[i] = 1; } } } if(seq[low]) seq[low] = 0; else seq[low] = 1; used[low] = true; ans[i] = low; answer(seq,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...