Submission #568572

#TimeUsernameProblemLanguageResultExecution timeMemory
568572stevancvCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "cave.h"
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 2e5 + 2;
const int M = 5e5 + 2;
int mod = 1000000007;
int tryCombination(vector<int> s);
void answer(vector<int> a, vector<int> b);
void exploreCave(int n) {
    vector<int> ans(n, -1);
    vector<int> sw(n, -1);
    for (int i = 0; i < n; i++) {
        vector<int> tmp(n);
        for (int j = 0; j < n; j++) {
            if (sw[j] == -1) tmp[j] = 0;
            else tmp[j] = sw[j];
        }
        int x = (tryCombination(tmp) == i);
        int l = 0, r = n - 1;
        while (l < r) {
            int mid = l + r >> 1;
            for (int j = 0; j <= mid; j++) {
                if (sw[j] == -1) tmp[j] = 1;
            }
            int y = (tryCombination(tmp) == i);
            if (x == y) l = mid + 1;
            else r = mid;
            for (int j = 0; j <= mid; j++) {
                if (sw[j] == -1) tmp[j] = 0;
            }
        }
        sw[l] = x;
        ans[l] = i;
    }
    answer(sw, ans);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:27:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   27 |             int mid = l + r >> 1;
      |                       ~~^~~
/usr/bin/ld: /tmp/ccUtAcjp.o: in function `exploreCave':
cave.cpp:(.text+0x24a): undefined reference to `tryCombination(std::vector<int, std::allocator<int> >)'
/usr/bin/ld: cave.cpp:(.text+0x373): undefined reference to `tryCombination(std::vector<int, std::allocator<int> >)'
/usr/bin/ld: cave.cpp:(.text+0x576): undefined reference to `answer(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status