Submission #670699

#TimeUsernameProblemLanguageResultExecution timeMemory
670699birthdaycakeCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "cave.h"
using namespace std;
int vs[101],val[101],sw[101];
void exploreCave(int N) {
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(!vs[j]){
                val[j] = 0;
            }
        }
        int x = tryCombination(val), what = 0;
        
        
        if(x == i + 1) what = 1;
        for(int j = 0; j < n; j++){
            if(!vs[j]){
                val[j] = !what;
            }
        }
        for(int j = 0; j < n; j++){
            if(!vs[j]){
                val[j] = what;
                int ii = tryCombination(val);
                if(ii > i + 1){
                    sw[j] = i + 1;
                    vs[j] = 1;
                    break;
                }
                val[j] = !what;
            }
        }
    }
    answer(val, sw);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:6:24: error: 'n' was not declared in this scope
    6 |     for(int i = 0; i < n; i++){
      |                        ^