제출 #819762

#제출 시각아이디문제언어결과실행 시간메모리
819762benjaminkleyn버섯 세기 (IOI20_mushrooms)C++17
컴파일 에러
0 ms0 KiB
#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; int count_mushrooms(int n) { bool A = true; for (int i = 0; i + 1 < n; i++) { cnt += A; A ^= use_machine({i, i + 1}); } return cnt + A; }

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

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:10:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   10 |         cnt += A;
      |         ^~~
      |         int
mushrooms.cpp:13:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   13 |     return cnt + A;
      |            ^~~
      |            int