제출 #1294787

#제출 시각아이디문제언어결과실행 시간메모리
1294787lucasdmyCounting Mushrooms (IOI20_mushrooms)C++20
컴파일 에러
0 ms0 KiB
#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;
int count_mushrooms(int n{
    int resp=0;
    for(int k=0;k<n-1;k+=2){
        resp+=2-use_machine({k, 0, k+1});
    }
    if(i%2==1){
        resp+=1-use_machine({0, n-1});
    }
    return resp;
}

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

mushrooms.cpp:4:26: error: expected ')' before '{' token
    4 | int count_mushrooms(int n{
      |                    ~     ^
      |                          )
mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:9:8: error: 'i' was not declared in this scope
    9 |     if(i%2==1){
      |        ^