Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
struct Disk{
	double x, y, r;
	int c, id;
}disk[30];
vector<Disk> colors[6];
char dp[1<<24];
double dis[25][25];
bool iscover(int a, int b){
	double r = (disk[a].r+disk[b].r)*(disk[a].r+disk[b].r);
	if(dis[a][b] < r){
		return true;
	}
	return false;
}
bool ontop(int a, int state){
	for(int i = 0; i < a; i++)
		if(!((state >> i) & 1) && iscover(i, a)){
			return false;
		}
	return true;
}
bool pairable(int a, int b, int state){
	if(!iscover(a, b) && ontop(a, state) && ontop(b, state))
		return true;
	return false;
}
int main(){
	int n;
	while(scanf("%d", &n), n){
		memset(dp, 0, sizeof(dp));
		for(int i = 1; i <= 4; i++)
			colors[i].clear();
		for(int i = 0; i < n; i++){
			scanf("%lf%lf%lf%d", &disk[i].x, &disk[i].y, &disk[i].r, &disk[i].c);
			disk[i].id = i;
			colors[disk[i].c].push_back(disk[i]);
		}
		for(int i = 0; i < n; i++)
			for(int j = 0; j < n; j++)
				dis[i][j] = (disk[i].x-disk[j].x)*(disk[i].x-disk[j].x)+(disk[i].y-disk[j].y)*(disk[i].y-disk[j].y);
		int M = 1 << n;
		for(int i = 0; i < M; i++){
			if(i > 0 && !dp[i])
				continue;
			for(int c = 1; c <= 4; c++){
				for(int j = 0; j < colors[c].size(); j++){
					if((1<<colors[c][j].id)& i)
						continue;
						for(int k = j+1; k < colors[c].size(); k++){
							if((1<<colors[c][k].id) & i)
								continue;
							if(pairable(colors[c][j].id, colors[c][k].id, i)){
								int nstate = i | (1<<colors[c][j].id) | (1<<colors[c][k].id);
								dp[nstate] = max(dp[nstate], dp[i]+2);
							}
						}
				}
			}
		}
		int ans = 0;
		for(int i = 0; i < M; i++)
			ans = max(ans, dp[i]);
		printf("%d\n", ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:81: error: no matching function for call to 'max(char&, int)'
   59 |                                                                 dp[nstate] = max(dp[nstate], dp[i]+2);
      |                                                                              ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:3:
/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:59:81: note:   deduced conflicting types for parameter 'const _Tp' ('char' and 'int')
   59 |                                                                 dp[nstate] = max(dp[nstate], dp[i]+2);
      |                                                                              ~~~^~~~~~~~~~~~~~~~~~~~~
/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:59:81: note:   mismatched types 'std::initializer_list<_Tp>' and 'char'
   59 |                                                                 dp[nstate] = max(dp[nstate], dp[i]+2);
      |                                                                              ~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:67:34: error: no matching function for call to 'max(int&, char&)'
   67 |                         ans = max(ans, dp[i]);
      |                               ~~~^~~~~~~~~~~~
/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:67:34: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'char')
   67 |                         ans = max(ans, dp[i]);
      |                               ~~~^~~~~~~~~~~~
/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
/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:67:34: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   67 |                         ans = max(ans, dp[i]);
      |                               ~~~^~~~~~~~~~~~