Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 100000000000000

vector<vector<ll>> f;
vector<vector<ll>> p;

ll n,output=-INF;

void dfs(ll time,bool OPEN,vector<bool> &open){//time:何番目の時間帯まで調べたか　OPEN:timeの時間帯に開いているか　
	if(time==10){
		bool all_close=true;//joisinoの店が全て閉まっていることは許されない
		for(ll i=0;i<10;i++){
			if(open[i]!=false){all_close=false;break;}
		}
		if(all_close){return;}


		int answer=0;
		for(ll i=0;i<n;i++){//店iについて
			ll how_many_one=0;//共通の時刻は何個か
			for(ll j=0;j<10;j++){
				if(f[i][j] && open[j]){how_many_one++;}
			}
			answer+=p[i][how_many_one];
		}
		output=max(output,answer);

		return;
	}

	if(OPEN){open[time]=true;}
	else{open[time]=false;}

	dfs(time+1,true,open);
	dfs(time+1,false,open);

	return;
}

int main(){
	cin>>n;
	f.assign(n,vector<ll>(10,0));//n個の店について、10個の時間帯に対し、開いているか
	p.assign(n,vector<ll>(11,0));//n個の店について、joisinoと同じ時間帯の個数に対する、利益

	for(ll i=0;i<n;i++){
		for(ll j=0;j<10;j++){
			cin>>f[i][j];
		}
	}

	for(ll i=0;i<n;i++){
		for(ll j=0;j<=10;j++){
			cin>>p[i][j];
		}
	}

	vector<bool> open(10,false);
	dfs(0,true,open);
	dfs(0,false,open);


	cout<<output<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'void dfs(long long int, bool, std::vector<bool>&)':
a.cc:28:27: error: no matching function for call to 'max(long long int&, int&)'
   28 |                 output=max(output,answer);
      |                        ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:28:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   28 |                 output=max(output,answer);
      |                        ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:28:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |                 output=max(output,answer);
      |                        ~~~^~~~~~~~~~~~~~~