Submission #992986

#TimeUsernameProblemLanguageResultExecution timeMemory
992986Yazan_SACave (IOI13_cave)C++17
0 / 100
35 ms348 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; /* int tryCombination(int S[]); void answer(int S[], int D[]); void exploreCave(int N); */ void exploreCave(int N) { int d[N]={},s[N]={}; bool dn[N]={}; int ts=tryCombination(s),ts2; for(int i=0; i<N; i++){ int l=0,r=N-1; while(l<=r){ if(l==r){ dn[l]=1; d[l]=i; if(ts<=i)s[l]^=1; break; } int md=(l+r)/2; for(int j=l; j<=md; j++){ if(dn[j])continue; s[j]^=1; } ts2=tryCombination(s); if((ts<=i && ts2>=i+1) || (ts>=i+1 && ts2<=i)){ r=md; ts=ts2; } else{ l=md+1; } for(int j=l; j<=md; j++){ if(dn[j])continue; s[j]^=1; } } } answer(s,d); }
#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...