제출 #1185690

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

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

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:17:23: error: expected primary-expression before ';' token
   17 |                 ans+=+;
      |                       ^