Submission #759680

#TimeUsernameProblemLanguageResultExecution timeMemory
759680AndreyCave (IOI13_cave)C++14
0 / 100
215 ms428 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int n) { int ans[n]; int sw[n]; int idk[n]; for(int i = 0; i < n; i++) { sw[i] = -1; } int l,r,m,x; for(int i = 0; i < n; i++) { l = 0; r = n-1; x = tryCombination(sw); while(l < r) { m = (l+r)/2; for(int j = 0; j < n; j++) { if(idk[j] != -1) { idk[j] = sw[j]; } else { if(j >= l && j <= m && sw[i] != -1) { idk[j] = 1; } else { idk[j] = 0; } } } if(tryCombination(sw) == x) { r = m; } else { l = m+1; } } ans[i] = l; if(x == -1 || x > i) { sw[i] = 0; } else { sw[i] = 1; } } answer(sw,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...