Submission #492929

#TimeUsernameProblemLanguageResultExecution timeMemory
492929aris12345678Cave (IOI13_cave)C++14
0 / 100
100 ms332 KiB
#include <bits/stdc++.h>
// #include "graderlib.cpp"
#include "cave.h"
using namespace std;

const int mxN = 5005;

void exploreCave(int n) {
    int switches[n];
    int pos[n];
    fill(switches, switches+n, 0);
    int j = 0, prev = tryCombination(switches);
    while(true) {
        switches[j] = !switches[j];
        int first = tryCombination(switches);
        if(first == -1) break;
        if(prev < first)
            switches[j] = !switches[j];
        j++;
        if(j == n)
            j = 0;
    }
    for(int i = 0; i < n; i++) {
        switches[i] = !switches[i];
        int first = tryCombination(switches);
        pos[i] = first;
        switches[i] = !switches[i];
    }
    answer(switches, pos);
}

// int main() {
//     int N = init();
//     exploreCave(N);
//     return 0;
// }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...