Submission #1096474

#TimeUsernameProblemLanguageResultExecution timeMemory
1096474TitanicXDzzCave (IOI13_cave)C++17
0 / 100
2061 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=0;ii<=mid;ii++){ if(che[ii]==0) a[ii]=1; } for(int ii=mid+1;ii<n;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...