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;
int n;
inline void subtask1(){
///every ith door -- ith switch
int comb[n];
int switchd[n];
memset(comb, 0, sizeof(comb));
for (int i = 0; i < n; ++i)
switchd[i] = i;
int door = tryCombination(comb);
while (door != -1){
comb[door] = 1;
door = tryCombination(comb);
}
answer(comb, switchd);
}
inline void subtask2(){
/// correct combination is 0, 0 ... 0, 0
int comb[n];
int Ans[n];
memset(comb, 0, sizeof(comb));
for (int i = 0; i < n; ++i){
comb[i] = 1;
Ans[i] = tryCombination(comb);
comb[i] = 0;
}
answer(comb, Ans);
}
void exploreCave(int N) {
n = N;
subtask1();
}
# | 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... |