Submission #1084694

#TimeUsernameProblemLanguageResultExecution timeMemory
1084694detaomegaCave (IOI13_cave)C++14
0 / 100
1 ms348 KiB
#include "cave.h"

void exploreCave(int N) {
    /* ... */
    int Key[N];
    bool isSuccess[N];
    for (int i = 0; i < N; i++) {
        Key[i] = 0;
        isSuccess[i] = 0;
    }
    int ansS[N], ansD[N];
      
    for (int i = 0; i < N; i++) {
        int value = tryCombination(Key);
        if (value > i) {
            for (int j = 0; j < N; j++) {
                if (!isSuccess[j]) {
                    Key[j] = Key[j] ^ 1;
                }
            }
        }
        for (int j = 0; j < N; j++) {
            Key[j] = Key[j] ^ 1;
            if (tryCombination(Key) > i) {
                ansD[j] = i;
                ansS[j] = Key[j];
                break;
            }
            Key[j] = Key[j] ^ 1;
        }
    }
    answer(ansS, ansD);
}
#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...