제출 #876988

#제출 시각아이디문제언어결과실행 시간메모리
876988AlphaMale06동굴 (IOI13_cave)C++14
0 / 100
35 ms600 KiB
#include<bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int n){ bool know[n]={0}; int st[n]; int ans[n]; int p[n]; for(int i=0; i< n; i++)st[i]=-1; for(int i=0; i<n; i++){ int comb[n]; for(int j=0; j< n; j++){ if(know[j])comb[j]=st[j]; else comb[j]=0; } int ans1=tryCombination(comb); int prev=ans1; int l=0; int r=n-1; while(l<r){ int cnt=0; int ind=l; for(int j=l; j<=r; j++){ ind=j; if(!know[j]){ cnt++; comb[j]=1-comb[j]; } if(cnt==(r-l+1)/2)break; } ans1=tryCombination(comb); if(ans1==prev){ l=ind+1; } else{ r=ind; } prev=ans1; } know[l]=1; if(ans1==i+1)st[l]=1; else st[l]=0; ans[i]=st[l]; p[i]=l; } answer(p, 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...