Submission #10425

# Submission time Handle Problem Language Result Execution time Memory
10425 2014-10-27T15:14:49 Z gs14004 Cave (IOI13_cave) C++
0 / 100
216 ms 512 KB
#include "cave.h"

int S[5005], D[5005];

void change(int s, int e){
    for(int i=s; i<=e; i++){
        S[i] ^= 1;
    }
}
int find(int pos, int n){
    int s = 0, e = n-1;
    while (s != e) {
        int m = (s+e)/2;
        int t1 = tryCombination(S);
        change(s,m);
        int t2 = tryCombination(S);
        change(s,m);
        if(t1 != t2) e = m;
        else s = m+1;
    }
    return s;
}

void exploreCave(int n){
    for (int i=0; i<n; i++) {
        D[i] = find(i,n);
        if(tryCombination(S) == i) S[i] ^= 1;
    }
    answer(S,D);
}
# Verdict Execution time Memory Grader output
1 Incorrect 76 ms 456 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 216 ms 448 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 512 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 512 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 92 ms 500 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -