Submission #7523

#TimeUsernameProblemLanguageResultExecution timeMemory
7523baneling100Cave (IOI13_cave)C++98
0 / 100
7 ms640 KiB
#include "cave.h" #include <vector> #include <stdio.h> using namespace std; vector <int> A; int S[5000], D[5000], Check[5000]; void exploreCave(int N) { int i, j, Left, Mid, Right, Value, Temp; for(i=0 ; i<N ; i++) { A.clear(); for(j=0 ; j<N ; j++) if(!Check[j]) A.push_back(j); Left=0; Right=A.size()-1; Value=tryCombination(S); while(Left<Right) { Mid=(Left+Right)/2; for(i=Left ; i<=Mid ; i++) S[A[i]]=1-S[A[i]]; Temp=tryCombination(S); for(i=Left ; i<=Mid ; i++) S[A[i]]=1-S[A[i]]; if(Value==i) { if(Temp>i || Temp==-1) Right=Mid-1; else Left=Mid+1; } else { if(Temp==i) Right=Mid-1; else Left=Mid+1; } } if(Value==i) S[A[Left]]=1-S[A[Left]]; D[A[Left]]=i; } 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...