제출 #569590

#제출 시각아이디문제언어결과실행 시간메모리
569590Aurora2005동굴 (IOI13_cave)C++14
0 / 100
283 ms448 KiB
#include<bits/stdc++.h> #include"cave.h" using namespace std; void exploreCave(int N){ vector<pair<int,int>> ans(N); for(int i=0;i<N;i++) ans[i] = make_pair(-1,-1); for(int i=0;i<N;i++){ int First[N]; for(int j=0;j<N;j++){ if(ans[j].first == -1) First[j] = 0; else First[j] = ans[j].second; } if(tryCombination(First) == i+1){ int l = 0,r = N; while(r-l > 1){ int m = (l+r)/2; int S[N]; for(int j=0;j<N;j++){ if(ans[j].first){ if(j < m) S[j] = 0; else S[j] = 1; } else S[j] = ans[j].second; } if(tryCombination(S) == i+1) r = m; else l = m; } ans[l].first = i+1; ans[l].second = 1; } else{ int l = 0,r = N; while(r-l > 1){ int m = (l+r)/2; int S[N]; for(int j=0;j<N;j++){ if(ans[j].first){ if(j < m) S[j] = 0; else S[j] = 1; } else S[j] = ans[j].second; } if(tryCombination(S) == i+1) l = m; else r = m; } ans[l].first = i+1; ans[l].second = 0; } } int ansS[N]; int ansD[N]; for(int i=0;i<N;i++){ ansS[i] = ans[i].second; ansD[i] = ans[i].first; } answer(ansS,ansD); }
#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...