Submission #992905

#TimeUsernameProblemLanguageResultExecution timeMemory
992905Yazan_SACave (IOI13_cave)C++17
0 / 100
18 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[i]=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(ts2!=ts){ r=md; ts=ts2; } else{ l=md+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...