This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Make CSP great again
//Vengeance
#include <bits/stdc++.h>
#include<cave.h>
#define TASK "TESTCODE"
#define Log2(x) 31 - __builtin_clz(x)
using namespace std;
const int N = 5e3;
int state[N + 1], door[N + 1];
void exploreCave(int n)
{
memset(door, -1, sizeof(door));
for (int i = 0; i < n; ++ i)
{
int low = 0, high = n - 1;
bool need = (tryCombination(state) == i);
while(low < high)
{
int mid = (low + high)/2;
for (int j = low; j <= mid; ++ j)
{
if (door[j] == -1)
{
state[j] = 1;
}
}
bool t = (tryCombination(state) == i);
for (int j = low; j <= mid; ++ j)
{
if (door[j] == -1)
{
state[j] = 0;
}
}
if (t == need)
{
low = mid + 1;
}
else
{
high = mid - 1;
}
}
door[low] = i;
state[low] = need;
}
answer(state, door);
}
/*void read()
{
}
void solve()
{
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
if (fopen(TASK".INP", "r"))
{
freopen(TASK".INP", "r", stdin);
//freopen(TASK".OUT", "w", stdout);
}
int t = 1;
bool typetest = false;
if (typetest)
{
cin >> t;
}
for (int __ = 1; __ <= t; ++ __)
{
//cout << "Case " << __ << ": ";
read();
solve();
}
}*/
# | 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... |