제출 #1185699

#제출 시각아이디문제언어결과실행 시간메모리
1185699islam_2010버섯 세기 (IOI20_mushrooms)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "mushrooms.h" using namespace std; int count_mushrooms(int n){ int i = 1; int ans = 0; while (i+1 < n){ int a = use_machine(0, i, i+1); if(i>=n){ break; } if(a==0){ i+=2; ans+=2; }else if(a==2){ ans++; i+=2; }else { int b = use_machine(0, i); if(b==0){ ans++; }i+=2; } }return ans; }

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

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:10:29: error: could not convert '0' from 'int' to 'std::vector<int>'
   10 |         int a = use_machine(0, i, i+1);
      |                             ^
      |                             |
      |                             int
mushrooms.cpp:21:33: error: could not convert '0' from 'int' to 'std::vector<int>'
   21 |             int b = use_machine(0, i);
      |                                 ^
      |                                 |
      |                                 int