답안 #1060453

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1060453 2024-08-15T14:52:09 Z Mihailo 버섯 세기 (IOI20_mushrooms) C++17
컴파일 오류
0 ms 0 KB
#include <cstdio>
#include <cstdlib>
#include <cstdarg>
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define xx first
#define yy second
#define pll pair<long long, long long>
#define MOD 1000000007
typedef long long ll;
using namespace std;
mt19937 mt(time(nullptr));

int solve(int l, int r) {
	if(l==r) return 1;
	int m=(l+r)/2;
	int left=solve(l, m);
	int right=solve(m+1, r);
	vector<int> v;
	v.pb(l);
	v.pb(m+1);
	if(use_machine(v)) {
		return left+(r-m)-right;
	}
	else {
		return left+right;
	}
}

int count_mushrooms(int N) {
	return solve(0, N-1);
}

Compilation message

mushrooms.cpp: In function 'int solve(int, int)':
mushrooms.cpp:23:5: error: 'use_machine' was not declared in this scope
   23 |  if(use_machine(v)) {
      |     ^~~~~~~~~~~
mushrooms.cpp:20:14: warning: control reaches end of non-void function [-Wreturn-type]
   20 |  vector<int> v;
      |              ^