Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <list>
#include <cstring>
#include <stack>
   
using namespace std;

struct Data
{
    int x;
    int y;
    int r;
    int c;
};

typedef struct Data D;

map<string, char> m;
vector<D> input;

int solve(string now)
{
    // cout << now << endl;
    // cout << (m.find(now) == m.end()) << endl;
    if(m.find(now) != m.end()) return m[now];
    // cout << "hey" << endl;
    m[now] = 0;
    vector<vector<int> >  colornum(5);
    // cout << "ho" << n << endl;
    for(int i = 0; i < input.size(); i++){
        if(now[i] == '0') continue;
        bool notcovered = true;
        // cout << i << " : " << input[i].x << " " << input[i].y << " " << input[i].r << " " << input[i].c << endl;
        for(int j = 0; j < i; j++){
            if(now[j] == '0') continue;
            // cout << i << "," << j << ":" << pow(input[i].x - input[j].x, 2) + pow(input[i].y - input[j].y, 2) << " " << pow(input[i].r + input[j].r, 2) << endl;
            if(pow(input[i].x - input[j].x, 2) + pow(input[i].y - input[j].y, 2) < pow(input[i].r + input[j].r, 2)){
                notcovered = false;
                break;
            }
        }
        if(notcovered) colornum[input[i].c].push_back(i);
    }
    for(int i = 1; i < 5; i++){
        // cout << "colornumsize " << colornum[i].size() << endl;
        if(colornum[i].size() > 1){
            for(int j = 0; j < colornum[i].size(); j++){
                for(int k = j + 1; k < colornum[i].size(); k++){
                    string newinput = "";
                    for(int l = 0; l < input.size(); l++){
                        if(now[l] == '0' || l == colornum[i][j] || l == colornum[i][k]) newinput += "0";
                        else newinput += "1";
                    }
                    // cout << newinput << endl;
                    m[now] = max(m[now], solve(newinput) + 2);   
                }
            }
        }
    }
    return m[now];
}



int main()
{
    int n;
    while(1){
        cin >> n;
        if(n == 0) break;
        input.clear();
        m.clear();
        for(int i = 0; i < n; i++){
            D tmpd;
            cin >> tmpd.x >> tmpd.y >> tmpd.r >> tmpd.c;
            input.push_back(tmpd);
        }
        string start = "";
        for(int i = 0; i < n; i++){
            start += "1";
        }
        cout << solve(start) << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int solve(std::string)':
a.cc:68:33: error: no matching function for call to 'max(std::map<std::__cxx11::basic_string<char>, char>::mapped_type&, int)'
   68 |                     m[now] = max(m[now], solve(newinput) + 2);
      |                              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/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:68:33: note:   deduced conflicting types for parameter 'const _Tp' ('char' and 'int')
   68 |                     m[now] = max(m[now], solve(newinput) + 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,
                 from a.cc:8:
/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:68:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'char'
   68 |                     m[now] = max(m[now], solve(newinput) + 2);
      |                              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~