Submission #1340677

#TimeUsernameProblemLanguageResultExecution timeMemory
1340677nickolasarapidisCave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 5000;

void exploreCave(int N){
    int S[N], D[N];
	memset(S, 0, sizeof(S));
	memset(D, -1, sizeof(D));
    for(int i = 0; i < N; i++){
        int l = 0, r = N - 1;
        int B = trycombination(S);
        while(l < r){
            int m = (l + r)/2; int L = l;
            for(int j = l; j < m; j++){
                if(D[i] == -1) S[i] = 1;
            }
            int A = tryCombination(C);
            if(A > i or A == -1){
                if(B == i) r = m;
                else l = m + 1;
            }
            else{
                if(B == i) l = m + 1;
                else r = m;
            }
            for(int j = L; j < m; j++){
                if(D[i] == -1) S[i] = 0;
            }
        }
        D[i] = l;
        if(B == i) S[i] = 1;
        else S[i] = 0;
    }
    answer(S, D);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:13:17: error: 'trycombination' was not declared in this scope; did you mean 'tryCombination'?
   13 |         int B = trycombination(S);
      |                 ^~~~~~~~~~~~~~
      |                 tryCombination
cave.cpp:19:36: error: 'C' was not declared in this scope
   19 |             int A = tryCombination(C);
      |                                    ^