답안 #1064828

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1064828 2024-08-18T18:16:41 Z XJP12 버섯 세기 (IOI20_mushrooms) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
//#include "mushrooms.h"
using namespace std;
typedef vector<int> vi;
int count_mushrooms(int n) {
	vi m;
	int c1=1;
    bool ban=true;
    for(int i=0; i<n; i+=2){
        m.clear();
        m.push_back(i);
        m.push_back(i+1);
        m.push_back(i+2);
        int x =use_machine(m);
        if(ban){
            if(x==0) c1+=2;
            if(x==2) c1+=1;
            if(x==1){
                m.clear();
                m.push_back(i+1);
                m.push_back(i+2);
                int y =use_machine(m);
                if(y==1) c1++;
                ban=false;
            }
        }else{
            if(x==2) c1+=1;
            if(x==1){
                m.clear();
                m.push_back(i+1);
                m.push_back(i+2);
                int y =use_machine(m);
                if(y==1) c1++;
                ban=true;
            }
        }
    }
	return c1;
}

Compilation message

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:14:16: error: 'use_machine' was not declared in this scope
   14 |         int x =use_machine(m);
      |                ^~~~~~~~~~~