제출 #786144

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

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