Language: C++

#include<bits/stdc++.h>
using namespace std;

int n;
int x[24],y[24],r[24],c[24];
bool memo[1<<24];
char bit_count[1<<24];

bool ok(int a,int bit){
    for(int i=0;i<a;i++){
        if(((bit>>i)&1)==0)continue;
        int dist=(x[i]-x[a])*(x[#include<bits/stdc++.h>
using namespace std;

int n;
int x[24],y[24],r[24],c[24];
bool memo[1<<24];
char bit_count[1<<24];

bool ok(int a,int bit){
    for(int i=0;i<a;i++){
        if(((bit>>i)&1)==0)continue;
        int dist=(x[i]-x[a])*(x[i]-x[a])+(y[i]-y[a])*(y[i]-y[a]);
        int sum=(r[i]+r[a])*(r[i]+r[a]);
        if(dist<sum)return false;
    }
    return true;
}

int dfs(int bit){
    memo[bit]=true;

    int ret=n;
    for(int i=0;i<n;i++)if((bit>>i)&1)ret--;

    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(((bit>>i)&1)==0)continue;
            if(((bit>>j)&1)==0)continue;
            int to_bit=(bit^(1<<i))^(1<<j);
            if(c[i]==c[j]&&ok(i,bit)&&ok(j,bit)&&!memo[to_bit]){
                ret=max(ret,dfs(to_bit));
            }
        }
    }


    return ret;
}

void solve(){
    fill_n(memo,1<<n,false);

    cout<<dfs((1<<n)-1)<<endl;
}

bool input(){
    cin>>n;
    if(!n)return false;
    for(int i=0;i<n;i++)cin>>x[i]>>y[i]>>r[i]>>c[i];
    return true;
}

void init(){
    for(int i=0;i<(1<<24);i++){
        for(int j=0;j<24;j++)if((i>>j)&1){
            bit_count[i]++;
        }
    }
}

int main(){
    init();
    while(input())solve();
    return 0;
}
i]-x[a])+(y[i]-y[a])*(y[i]-y[a]);
        int sum=(r[i]+r[a])*(r[i]+r[a]);
        if(dist<sum)return false;
    }
    return true;
}

int dfs(int bit){
    memo[bit]=true;

    int ret=n;
    for(int i=0;i<n;i++)if((bit>>i)&1)ret--;

    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(((bit>>i)&1)==0)continue;
            if(((bit>>j)&1)==0)continue;
            int to_bit=(bit^(1<<i))^(1<<j);
            if(c[i]==c[j]&&ok(i,bit)&&ok(j,bit)&&!memo[to_bit]){
                ret=max(ret,dfs(to_bit));
            }
        }
    }


    return ret;
}

void solve(){
    fill_n(memo,1<<n,false);

    cout<<dfs((1<<n)-1)<<endl;
}

bool input(){
    cin>>n;
    if(!n)return false;
    for(int i=0;i<n;i++)cin>>x[i]>>y[i]>>r[i]>>c[i];
    return true;
}

void init(){
    for(int i=0;i<(1<<24);i++){
        for(int j=0;j<24;j++)if((i>>j)&1){
            bit_count[i]++;
        }
    }
}

int main(){
    //init();
    while(input())solve();
    return 0;
}

Compiler output:
a.cc:12:33: error: stray '#' in program
   12 |         int dist=(x[i]-x[a])*(x[#include<bits/stdc++.h>
      |                                 ^
a.cc: In function 'bool ok(int, int)':
a.cc:12:34: error: 'include' was not declared in this scope
   12 |         int dist=(x[i]-x[a])*(x[#include<bits/stdc++.h>
      |                                  ^~~~~~~
a.cc:12:42: error: 'bits' was not declared in this scope; did you mean 'bit'?
   12 |         int dist=(x[i]-x[a])*(x[#include<bits/stdc++.h>
      |                                          ^~~~
      |                                          bit
a.cc:12:47: error: 'stdc' was not declared in this scope; did you mean 'std'?
   12 |         int dist=(x[i]-x[a])*(x[#include<bits/stdc++.h>
      |                                               ^~~~
      |                                               std
a.cc:13:1: error: expected primary-expression before 'using'
   13 | using namespace std;
      | ^~~~~
a.cc:12:56: error: expected ']' before 'using'
   12 |         int dist=(x[i]-x[a])*(x[#include<bits/stdc++.h>
      |                                                        ^
      |                                                        ]
   13 | using namespace std;
      | ~~~~~                                                   
a.cc:12:56: error: expected ')' before 'using'
   12 |         int dist=(x[i]-x[a])*(x[#include<bits/stdc++.h>
      |                              ~                         ^
      |                                                        )
   13 | using namespace std;
      | ~~~~~                                                   
a.cc:20:23: error: a function-definition is not allowed here before '{' token
   20 | bool ok(int a,int bit){
      |                       ^
a.cc:30:17: error: a function-definition is not allowed here before '{' token
   30 | int dfs(int bit){
      |                 ^
a.cc:51:13: error: a function-definition is not allowed here before '{' token
   51 | void solve(){
      |             ^
a.cc:57:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   57 | bool input(){
      |           ^~
a.cc:57:11: note: remove parentheses to default-initialize a variable
   57 | bool input(){
      |           ^~
      |           --
a.cc:57:11: note: or replace parentheses with braces to value-initialize a variable
a.cc:57:13: error: a function-definition is not allowed here before '{' token
   57 | bool input(){
      |             ^
a.cc:64:12: error: a function-definition is not allowed here before '{' token
   64 | void init(){
      |            ^
a.cc:72:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   72 | int main(){
      |         ^~
a.cc:72:9: note: remove parentheses to default-initialize a variable
   72 | int main(){
      |         ^~
      |         --
a.cc:72:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:72:11: error: a function-definition is not allowed here before '{' token
   72 | int main(){
      |           ^
a.cc:77:2: error: expected ';' before ']' token
   77 | i]-x[a])+(y[i]-y[a])*(y[i]-y[a]);
      |  ^
      |  ;