제출 #346217

#제출 시각아이디문제언어결과실행 시간메모리
346217SecretK버섯 세기 (IOI20_mushrooms)C++14
컴파일 에러
0 ms0 KiB
#include "mushrooms.h" int count_mushrooms(int n) { std::vector<int> m; bool a = 0; int ans = 1; for (int i = 0; i < n; i++){ if(use_machine(i,i+1) == 1){ if(a) a = 0; else a = 1; } if(!a) ans++; } return ans; }

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

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:8:18: error: could not convert 'i' from 'int' to 'std::vector<int>'
    8 |   if(use_machine(i,i+1) == 1){
      |                  ^
      |                  |
      |                  int