Submission #970603

# Submission time Handle Problem Language Result Execution time Memory
970603 2024-04-26T18:44:34 Z Acanikolic Cave (IOI13_cave) C++14
0 / 100
24 ms 348 KB
#include <bits/stdc++.h>

#include "cave.h"

using namespace std;

void exploreCave(int N) {
    int S[N],D[N];
    for(int i = 0; i < N; i++) {
        S[i] = 0;
        D[i] = -1;
    }
    for(int k = 0; k < N; k++) {
        int index = tryCombination(S);
        if(index == -1) break;
        for(int j = 0; j < N; j++) {
            if(D[j] != -1) continue;
            S[j] ^= 1;
            if(tryCombination(S) > index || tryCombination(S) == -1) {
                D[j] = index;
                break;
            }
            S[j] ^= 1;
        }
    }
    int SS[N];
    for(int i = 0; i < N; i++) {
        SS[i] = 0;
    }
    for(int i = 0; i < N; i++) if(D[i] != -1) SS[i] = S[i];
    for(int k = 0; k < N; k++) {
        int index = tryCombination(SS);
        if(index == -1) break;
        for(int j = 0; j < N; j++) {
            if(D[j] != -1) continue;
            SS[j] ^= 1;
            if(tryCombination(SS) > index || tryCombination(SS) == -1) {
                D[j] = index;
                break;
            }
            SS[j] ^= 1;
        }
    }
    answer(S,D);
}
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 344 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 344 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 344 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -