제출 #1096484

#제출 시각아이디문제언어결과실행 시간메모리
1096484TitanicXDzz동굴 (IOI13_cave)C++14
0 / 100
2066 ms348 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; int a[5010]; int ans[5010]; int che[5010]; void exploreCave(int n) { for(int i=0;i<n;i++){ for(int ii=0;ii<n;i++){ if(che[ii]==0){ a[ii]=1; } } int ret=tryCombination(a); int l=0; int r=n-1; while(l<r){ int mid=(l+r)/2; for(int ii=l;ii<=mid;ii++){ if(che[ii]==0) a[ii]=1; } for(int ii=mid+1;ii<=r;ii++){ if(che[ii]==0) a[ii]=0; } int res=tryCombination(a); if((ret==i&&res==i)||(ret!=i&&res!=i)){ r=mid; } else l=mid+1; } che[l]=1; ans[l]=i; if(ret==i) a[l]=0; else a[l]=1; } answer(a,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...