제출 #346054

#제출 시각아이디문제언어결과실행 시간메모리
346054athensclub버섯 세기 (IOI20_mushrooms)C++14
컴파일 에러
0 ms0 KiB

#include <vector>

int div2RoundUp(int x)
{
	int d = x / 2;
	if (d * 2 < x)
		return d + 1;
	return d;
}

int count_mushrooms(int n)
{
	std::vector<int> m;
	for (int i = 0; i < n; i++)
		m.push_back(i);
	int c1 = use_machine(m);
	m = {0, 1};
	int c2 = use_machine(m);
	return c2 == 1 ? div2RoundUp(c1) : n - div2RoundUp(c1);
}

컴파일 시 표준 에러 (stderr) 메시지

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:17:11: error: 'use_machine' was not declared in this scope
   17 |  int c1 = use_machine(m);
      |           ^~~~~~~~~~~