제출 #1347568

#제출 시각아이디문제언어결과실행 시간메모리
1347568hmms127버섯 세기 (IOI20_mushrooms)C++20
컴파일 에러
0 ms0 KiB
#include "mushrooms.h"

int count_mushrooms(int n) {
	int cnt=1;
	for (int i=1;i<n-1;i+=2)cnt+=2-use_machine({0,i,i+1});
	if (n%2)cnt+=1-use_machine(0,n-1);
	return cnt;




}

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

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:6:36: error: could not convert '0' from 'int' to 'std::vector<int>'
    6 |         if (n%2)cnt+=1-use_machine(0,n-1);
      |                                    ^
      |                                    |
      |                                    int