# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
107183 | stefdasca | Cave (IOI13_cave) | C++14 | 1258 ms | 640 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
IOI 13-Cave
The 70.000 queries limit suggests us that we should find the switch for each node in O(log n) questions.
At each step, we will firstly find out which is the state for switch corresponding to door i, and then
we will use binary search on the possible range of the answer
*/
#include "cave.h"
#include<bits/stdc++.h>
void exploreCave(int N)
{
int S[N+2], D[N+2];
memset(S, 0, sizeof(S));
memset(D, 0, sizeof(D));
int P[N+2], pus[N+2];
memset(P, 0, sizeof(P));
memset(pus, 0, sizeof(pus));
for(int i = 0; i < N; ++i)
{
int st = 0;
int dr = N-1;
for(int j = 0; j < N; ++j)
if(pus[j])
P[j] = S[j];
else
P[j] = 1;
int ans = tryCombination(P);
bool ce = 0;
if(ans > i || ans == -1)
# | 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... |