이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 10;
int s[maxn], p[maxn];
void exploreCave(int n){
vector<int> Key;
for (int i = 0; i < n; i++)
Key.push_back(i);
for (int i = 0; i < n; i++){
int lo = 0, hi = Key.size();
bool last = (tryCombination(s) == i);
while (hi - lo > 1){
int mid = (lo + hi) >> 1;
for (int j = lo; j < mid; j++)
s[Key[j]] ^= 1;
bool now = (tryCombination(s) == i);
if (now == last)
lo = mid;
else
hi = mid, last ^= 1;
}
if (last == 1)
s[Key[lo]] ^= 1;
p[Key[lo]] = i;
Key.erase(Key.begin()+lo);
}
answer(s, p);
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |