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++){
int aux = tryCombination(S);
int color = (aux == door ? 1 : 0);
for(int s = 0; s < n; s++){
if(mark[s]) continue;
S[s] = !color;
}
int Switch = 0;
for(int s = 0; s < n; s++){
if(mark[s]) continue;
S[s] = color;
int t = tryCombination(S);
if(t != door){
Switch = s;
break;
}
S[s] = !color;
}
mark[Switch] = true;
S[Switch] = color;
D[Switch] = door;
}
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... |