# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
985413 | SzymonKrzywda | Cave (IOI13_cave) | C++17 | 1 ms | 348 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"cave.h"
#include <bits/stdc++.h>
using namespace std;
int tryCombination(int S[]);
void answer(int S[],int D[]);
void exploreCave(int N){
int D[N],S[N],w=0,w_2=0;
for (int i=0; i<N; i++) D[i] = -1;
bool good[N];
//int S_2[N];
// 0 0 0 0 0
// 1 1 1 1 1
// 1 1 1 1 0
//1110
//3102
for (int i=0; i<N; i++){
w = tryCombination(S);
if (!(w == -1 || w > i)){
for (int i=0; i<N; i++){
if (D[i] == -1) S[i] = (S[i]+1)%2;
}
//w = tryCombination(S);
}
//cout << i << " "<< w << endl;
//if(w==-1) break;
//if (w > i) continue;
for (int j=0; j<N; j++){
S[j] = (S[j]+1)%2;
w_2 = tryCombination(S);
if (w_2 == i){
D[j] = i;
S[j] = (S[j]+1)%2;
break;
}
S[j] = (S[j]+1%2);
}
}
answer(S,D);
}
Compilation message (stderr)
# | 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... |