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<bits/stdc++.h>
#include "cave.h"
using namespace std;
typedef long long ll;
const int MAX = 2e6 + 15;
const int INF = 0x3f3f3f3f;
//Subtask 3 : N <= 100
bool mark[MAX];
void exploreCave(int n){
int S[n] = { 0 }, D[n] = { 0 };
for(int door = 0; door < n; door++){
for(int i = 0; i < n; i++){
if(mark[i]) continue;
S[i] = 0;
}
int color = (tryCombination(S) == door), pos = -1;
for(int i = 0; i < n; i++){
if(mark[i]) continue;
S[i] = !color;
}
for(int i = 0; i < n && pos != -1; i++){
if(mark[i]) continue;
S[i] = color;
if(tryCombination(S) != door) pos = i;
S[i] = !color;
}
assert(pos != -1);
mark[pos] = true;
D[pos] = door;
S[pos] = color;
}
answer(S, D);
}
# | 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... |