# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116632 | roseanne_pcy | Cave (IOI13_cave) | C++14 | 1287 ms | 684 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.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pb push_back
bool solved[5005];
int sol[5005];
int connect[5005];
int arr[5005];
int tmp[5005];
vi cand;
void exploreCave(int n)
{
for(int i = 0; i< n; i++) cand.pb(i);
for(int it = 0; it< n-1; it++)
{
//printf("-----iteration %d\n", it);
for(int i = 0; i< n; i++) if(solved[i]) arr[i] = sol[i];
for(int i = 0; i< (int) cand.size(); i++) arr[cand[i]] = 0;
int last = tryCombination(arr);
if(last == -1) last = 1e9;
int L = 0, R = cand.size()-1;
memset(tmp, 0, sizeof tmp);
while(L< R)
{
//printf("L = %d and R = %d\n", L, R);
int mid = (L+R)/2;
for(int i = 0; i< n; i++) if(solved[i]) arr[i] = sol[i];
for(int i = mid+1; i<= R; i++) if(!solved[cand[i]]) arr[cand[i]] = 1-arr[cand[i]];
int x = tryCombination(arr);
# | 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... |