제출 #628878

#제출 시각아이디문제언어결과실행 시간메모리
628878dqhungdl드문 곤충 (IOI22_insects)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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);
      |                     ^~~~~~~~~~~~