Submission #786144

#TimeUsernameProblemLanguageResultExecution timeMemory
786144vjudge1Rarest Insects (IOI22_insects)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;
// void move_inside(int);
// void move_outside(int);
// int press_button();

int min_cardinality(int N)
{
        vector<int> types(N, -1);
        int t = 0;
        for (int i = 0; i < N; i++) {
                if (types[i] != -1)
                        continue;
                types[i] = t;
                move_inside(i);
                for (int j = i + 1; j < N; j++) {
                        move_inside(j);
                        int ret = press_button();
                        if (ret > 1)
                                types[j] = t;
                        move_outside(j);
                }
                t++;
        }
        vector<int> cnt(t);
        for (int i = 0; i < N; i++)
                cnt[types[i]]++;
        int mn = cnt[0];
        for (auto x : cnt)
                if (x < mn)
                        mn = x;
        return mn;
}

Compilation message (stderr)

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:16:17: error: 'move_inside' was not declared in this scope
   16 |                 move_inside(i);
      |                 ^~~~~~~~~~~
insects.cpp:19:35: error: 'press_button' was not declared in this scope
   19 |                         int ret = press_button();
      |                                   ^~~~~~~~~~~~
insects.cpp:22:25: error: 'move_outside' was not declared in this scope
   22 |                         move_outside(j);
      |                         ^~~~~~~~~~~~