Submission #116632

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1166322019-06-13 09:13:50roseanne_pcyCave (IOI13_cave)C++14
100 / 100
1287 ms684 KiB
#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);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...