Submission #628878

#TimeUsernameProblemLanguageResultExecution timeMemory
628878dqhungdlRarest Insects (IOI22_insects)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int min_cardinality(int N) { vector<int> P(N, -1); int rs = 1e9; for (int i = 0; i < N; i++) if (P[i] == -1) { P[i] = i; move_inside(i); int cnt = 1; for (int j = i + 1; j < N; j++) if (P[j] == -1) { move_inside(j); if (cnt + 1 == press_button()) { cnt++; P[j] = i; } else move_outside(j); } rs = min(rs, cnt); for (int j = i; j < N; j++) if (P[j] == i) move_outside(j); } return rs; }

Compilation message (stderr)

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:10:13: error: 'move_inside' was not declared in this scope
   10 |             move_inside(i);
      |             ^~~~~~~~~~~
insects.cpp:15:36: error: 'press_button' was not declared in this scope
   15 |                     if (cnt + 1 == press_button()) {
      |                                    ^~~~~~~~~~~~
insects.cpp:19:25: error: 'move_outside' was not declared in this scope
   19 |                         move_outside(j);
      |                         ^~~~~~~~~~~~
insects.cpp:24:21: error: 'move_outside' was not declared in this scope
   24 |                     move_outside(j);
      |                     ^~~~~~~~~~~~