# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
770509 | Tymond | Cave (IOI13_cave) | C++17 | 0 ms | 0 KiB |
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>
using namespace std;
void answer(int S[], int D[]);
int tryCombination(int S[]);
void exploreCave(int n){
int S[n];
for(int i = 0; i <= n - 1; i++){
S[i] = 0;
}
for(int i = 0; i <= n - 1; i++){
int kture = tryCombination(S);
if(kture == i){
continue;
}
for(int j = 0; j <= n - 1; j++){
if(S[j] == 0){
S[j] = 1;
int kture = tryCombination(S);
if(kture == i){
continue;
}
S[j] = 0;
}else{
S[j] = 0;
int kture = tryCombination(S);
if(kture == i){
continue;
}
S[j] = 1;
}
}
}
int D[n];
for(int i = 0; i <= n - 1; i++){
if(S[i] == 0){
S[i] = 1;
int kture = tryCombination(S);
D[i] = kture;
S[i] = 0;
}else{
S[i] = 0;
int kture = tryCombination(S);
D[i] = kture;
S[i] = 1;
}
}
answer(S, D);
}
int main(){
ios_base::sync_with_stido(0);
cin.tie(0);
cout.tie(0);
/*int n;
cin >> n;
exploreCave(n);
*/
}