This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
int stan[5000];
int matching[5000];
int is_set[5000];
int try_[5000];
void exploreCave(int N) {
for(int i = 0; i < N; i++)
{
for(int j = 0; j < N; j++)
{
try_[j] = stan[j];
}
int ans = tryCombination(try_);
int s = 0;
if(ans == i)
{
s = 1;
}
int pocz = 0;
int kon = N-1;
while(pocz < kon)
{
int srod = (pocz+kon)/2;
for(int j = 0; j < N; j++)
{
if(is_set[j] == 1) try_[j] = stan[j];
else
{
if(j <= srod) try_[j] = s;
else try_[j] = s ^ 1;
}
}
if(tryCombination(try_) == i)
{
pocz = srod+1;
}
else
{
kon = srod;
}
}
is_set[kon] = 1;
stan[kon] = s;
matching[kon] = i;
}
answer(stan,matching);
}
# | 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... |