Submission #715839

#TimeUsernameProblemLanguageResultExecution timeMemory
715839ovidiush11Cave (IOI13_cave)C++14
0 / 100
103 ms340 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N) { int st[N]={0},direction[N]={0},pos[N]={0}; int last = tryCombination(direction); for(int i = 0;i < N-1;i++) { int left = 0,right = N-1; while(left != right) { int mid = (left + right) / 2; for(int j = left;j < mid;j++)if(st[i] == 0)direction[i] = (direction[i] + 1) % 2; int x = tryCombination(direction); if((x > i && last > i) || (x <= i && last <= i))left = mid+1; else right = mid; last = x; } if(last <= i)direction[left] = (direction[left] + 1) % 2; st[left] = 1; pos[i] = left; } answer(direction,pos); }
#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...