제출 #424236

#제출 시각아이디문제언어결과실행 시간메모리
424236Apiram버섯 세기 (IOI20_mushrooms)C++14
0 / 100
0 ms200 KiB
#include "mushrooms.h"
#include<bits/stdc++.h>
using namespace std;
int solve (int left,int right){
	vector<int>arr;
	if (left>=right)return 0;
	for (int i =left;i<right;++i){
		arr.push_back(i);
	}
	int mid = left + right >>1;
	int a= use_machine(arr);
	if (a==0){
		a=use_machine({0,left});
		if (a==0){
			return right - left +1;
		}
		else return 0;
	}
	else return solve(left,mid)+solve(mid,right);
}
int count_mushrooms(int n) {
	return solve(1,n);
}

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

mushrooms.cpp: In function 'int solve(int, int)':
mushrooms.cpp:10:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   10 |  int mid = left + right >>1;
      |            ~~~~~^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...