Submission #1263253

#TimeUsernameProblemLanguageResultExecution timeMemory
1263253bluevioletCave (IOI13_cave)C++20
0 / 100
74 ms328 KiB
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
const int Inf = (int)2e9 + 7;




bool vst[5009];


void exploreCave(int N) {
 
    int n = N;
    int s[N], d[N];

    while (true) {
        int firstClosed = tryCombination(s);
        if (firstClosed == -1) break;

        for (int i=0; i<n; i++) {
          if (vst[i]) continue;
        	s[i] ^= 1;
        	
        	int pp = tryCombination(s);
        	if (pp == -1) pp = Inf;
        	if (pp > firstClosed) {
        		d[i] = firstClosed;
        		vst[i] = true;
        		break;
        	} else
        		s[i] ^= 1;
        }
    }
    answer(s, d);
}
#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...