criyle/codenet-compile-errors huggingface dataset:
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
#include <utility>

using namespace std;
typedef long long ll;

#define ALL(c) begin((c)), end((c))
#define REP(i,n) for(ll i=0;i<(ll)n;++i)
inline int getInt() { int s; scanf("%d", &s); return s; }

#define SIZE 10
typedef array<array<int, SIZE>, SIZE> Table;

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int g_c;

void fillColor(Table & state, int from, int to, int x, int y){
	if (from==to) return;
	REP(i, 4){
		if(state[y+dy[i]][x+dx[i]] != from) continue;
		state[y+dy[i]][x+dx[i]] = to;
		fillColor(state, from, to, x+dx[i], y+dy[i]);
	}
}

int countColor(Table & state, int x, int y){
	int cnt = 0;
	REP(i, 4) {
		if (state[y + dy[i]][x + dx[i]] != g_c) continue;
		state[y + dy[i]][x + dx[i]] = -1;
		cnt += 1 + countColor(state, x + dx[i], y + dy[i]);
	}
	return cnt;
}

int recursion(int depth, Table state) {
	if (depth > 5) return countColor(state, 1, 1);
	
	int cnt = 1;
	REP(i, 6) {
		if(depth==5 && i != g_c) continue;
		Table ntable = state;
		ntable[1][1] = i;
		fillColor(ntable, state[1][1], i, 1, 1);
		cnt = max(recursion(depth+1, ntable),cnt);
	}
	return cnt;
}

int main() {
	while (true) {
		ll h,w;
		cin >> h >> w 
		if (h == 0) break;
		
		g_c = getInt() - 1;
		Table table;
		REP(y, SIZE) REP(x, SIZE) table[y][x] = -1;
		REP(y, h) REP(x, w) table[y + 1][x + 1] = getInt()-1;
		cout << walk(1, table) << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:30: error: expected ';' before 'if'
   58 |                 cin >> h >> w
      |                              ^
      |                              ;
   59 |                 if (h == 0) break;
      |                 ~~            
a.cc:65:25: error: 'walk' was not declared in this scope
   65 |                 cout << walk(1, table) << endl;
      |                         ^~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
#include <utility>

using namespace std;
typedef long long ll;

#define ALL(c) begin((c)), end((c))
#define REP(i,n) for(ll i=0;i<(ll)n;++i)

inline int getInt() { int s; scanf("%d", &s); return s; }

#define SIZE 10
typedef array<array<int, SIZE>, SIZE> Table;

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int g_c;

void fillColor(Table & state, int from, int to, int x, int y){
	if (from==to) return;
	REP(i, 4){
		if(state[y+dy[i]][x+dx[i]] != from) continue;
		state[y+dy[i]][x+dx[i]] = to;
		fillColor(state, from, to, x+dx[i], y+dy[i]);
	}
}

int countColor(Table & state, int x, int y){
	int cnt = 0;
	REP(i, 4) {
		if (state[y + dy[i]][x + dx[i]] != g_c) continue;
		state[y + dy[i]][x + dx[i]] = -1;
		cnt += 1 + countColor(state, x + dx[i], y + dy[i]);
	}
	return cnt;
}

int recursion(int depth, Table state) {
	if (depth > 5) return countColor(state, 1, 1);
	
	int cnt = 1;
	REP(i, 6) {
		if(depth==5 && i != g_c) continue;
		Table ntable = state;
		ntable[1][1] = i;
		fillColor(ntable, state[1][1], i, 1, 1);
		cnt = max(recursion(depth+1, ntable),cnt);
	}
	return cnt;
}

int main() {
	while (true) {
		ll h,w;
		cin >> h >> w;
		if (h == 0) break;
	
		g_c = getInt() - 1;
		Table table;
		REP(y, SIZE) REP(x, SIZE) table[y][x] = -1;
		REP(y, h) REP(x, w) table[y + 1][x + 1] = getInt()-1;
		cout << recutsion(1, table) << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:25: error: 'recutsion' was not declared in this scope; did you mean 'recursion'?
   66 |                 cout << recutsion(1, table) << endl;
      |                         ^~~~~~~~~
      |                         recursion
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
#include <utility>

using namespace std;
typedef long long ll;

#define ALL(c) begin((c)), end((c))
#define REP(i,n) for(ll i=0;i<(ll)n;++i)

inline int getInt() { int s; scanf("%d", &s); return s; }

#define SIZE 10
typedef array<array<int, SIZE>, SIZE> Table;

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int g_c;

void fillColor(Table &state, int from, int to) {
	if (from==to) return;
	vector<pair<int,int>> stack;
	stack.emplace_back(1,1);
	while (!stack.empty()) {
		int x,y; tie(x, y) = stack.back();
		stack.pop_back();
		REP(i, 4) {
			int nx = x + dx[i];
			int ny = y + dy[i];
			if (state[ny][nx] == from) {
				stack.emplace_back(nx,ny);
				state[ny][nx] = to;
			}
		}
	}
}

int countColor(Table & state) {
	vector<pair<int, int>> stack;
	stack.emplace_back(1, 1);
	int cnt = 0;
	while (!stack.empty()) {
		int x,y; tie(x, y) = stack.back();
		stack.pop_back();

		REP(i, 4) {
			int nx = x + dx[i];
			int ny = y + dy[i];
			if (state[ny][nx] == g_c) {
				stack.emplace_back(nx, ny);
				cnt++;
				state[ny][nx] = -1;
			}
		}
	}
	return cnt;
}

int recursion(int depth, Table state) {
	if (depth > 5) return countColor(state);
	
	int cnt = 1;
	REP(i, 6) {
		if(depth==5 && i != g_c) continue;
		Table ntable = state;
		ntable[1][1] = i;
		fillColor(ntable, state[1][1], i);
		cnt = max(recursion(depth+1, ntable),cnt);
	}
	return cnt;
}

int main() {
	while (true) {
		ll h,w;
		cin >> h >> w 
		if (h == 0) break;
		
		g_c = getInt() - 1;
		Table table;
		REP(y, SIZE) REP(x, SIZE) table[y][x] = -1;
		REP(y, h) REP(x, w) table[y + 1][x + 1] = getInt()-1;
		cout << recursion(1, table) << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:79:30: error: expected ';' before 'if'
   79 |                 cin >> h >> w
      |                              ^
      |                              ;
   80 |                 if (h == 0) break;
      |                 ~~
Language: Java

import java.io.*;
import java.util.Scanner;

public class disc {

	private static Scanner sc = new Scanner(System.in);

		class circle{
			int x;
			int y;
			int r;
			int c;
	  			
	  			circle(Scanner sc){
	  				this.x=sc.nextInt();
	  				this.y=sc.nextInt();
	  				this.r=sc.nextInt();
	  				this.c=sc.nextInt();
	  		}
	  			
	  			Boolean isCoveredBy(circle another){
	  					return Math.sqrt((this.x-another.x)^2+(this.y-another.y)^2)<this.r+another.r;
	  					  				
	  			}
	  	
	  
  }

		private String cal() throws IOException{
			
			for(;;){	
				int n=sc.nextInt();
				if(n==0)
					break;
				
				circle[] circles=new circle[n];
				int[] coverbit=new int[n];
				
				for(int i=0;i<n;i++){
					circles[i]=new circle(sc);
					
					for(int j=0;j<i;j--)
						if(circles[i].isCoveredBy(circles[j]))
							coverbit[i]|=(1<<j);
				}
				
				int Max=0;
				boolean PossibleBit[]=new boolean[1<<n];
				PossibleBit[0]=true;
				
				for(int i=0;i<(1<<n);i++){
					
					if(!PossibleBit[i])
						continue;
					
					Max=Math.max(Integer.bitCount(i),Max);
					
					for(int first=0;first<n;first++){
						if((~i & coverbit[first])!=0 || (i&1<<first)!=0) 
							continue;
						
						for(int second=first+1;second<n;second++){
							if((~i & coverbit[second])!=0 || (i&1<<second)!=0)
								continue;
							if(circles[first].c!=circles[second].c)
								continue;
							
							PossibleBit[i|(1<<first)|(1<<second)]=true;
						}
					
					}
						


					return Integer.toString(Max);
					
				}
				
				
			}
			return null;

		}
	  
	public static void main ( String [] args ) throws IOException{
    	
	  new disc().cal();
    }
	
    
}

Compiler output:
Main.java:4: error: class disc is public, should be declared in a file named disc.java
public class disc {
       ^
1 error
Language: Java

import java.io.*;
import java.util.Scanner;

public class disc {

	private static Scanner sc = new Scanner(System.in);

		class circle{
			int x;
			int y;
			int r;
			int c;
	  			
	  			circle(Scanner sc){
	  				this.x=sc.nextInt();
	  				this.y=sc.nextInt();
	  				this.r=sc.nextInt();
	  				this.c=sc.nextInt();
	  		}
	  			
	  			Boolean isCoveredBy(circle another){
	  					return Math.sqrt((this.x-another.x)*(this.x-another.x)+(this.y-another.y)*(this.y-another.y))<this.r+another.r;
	  					  				
	  			}
	  	
	  
  }

		private void cal() throws IOException{
			
			for(;;){	
				int n=sc.nextInt();
				if(n==0)
					break;
				
				circle[] circles=new circle[n];
				int[] coverbit=new int[n];
				
				for(int i=0;i<n;i++){
					circles[i]=new circle(sc);
					
					for(int j=i-1;j>=0;j--)
					    if(circles[i].isCoveredBy(circles[j]))
						coverbit[i]|=(1<<j);
						
					    
				}
				
				int Max=0;
				boolean PossibleBit[]=new boolean[1<<n];
				PossibleBit[0]=true;
				
				for(int i=0;i<(1<<n);i++){
					
					if(!PossibleBit[i])
						continue;
				
					Max=Math.max(Integer.bitCount(i),Max);
					for(int first=0;first<n;first++){
					    if((~i & coverbit[first])!=0 || (i&1<<first)!=0)
						continue;
						for(int second=first+1;second<n;second++){
							if((~i & coverbit[second])!=0 || (i&1<<second)!=0)
								continue;
							if(circles[first].c!=circles[second].c)
								continue;
							
							PossibleBit[i|(1<<first)|(1<<second)]=true;
						}
					
					}
						


					
				}
				
						System.out.println(Integer.toString(Max));
				
			}
		}

	public static void main ( String [] args ) throws IOException{
    	
	  new disc().cal();
    }
	
    
}

Compiler output:
Main.java:4: error: class disc is public, should be declared in a file named disc.java
public class disc {
       ^
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;


public class D {
	
	public static boolean is_covered(int node, int bit, boolean[][] adj){
		for(int upper = node - 1; upper >= 0; upper--){
			if((bit & (1 << upper)) != 0){
				continue;
			}else if(adj[upper][node]){
				return true;
			}
		}
		
		return false;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			final int n = sc.nextInt();
			
			if(n == 0){
				break;
			}
			
			int[] x_pos  = new int[n];
			int[] y_pos  = new int[n];
			int[] rs     = new int[n];
			int[] colors = new int[n];
			
			for(int i = 0; i < n; i++){
				x_pos[i]  = sc.nextInt();
				y_pos[i]  = sc.nextInt();
				rs[i]     = sc.nextInt();
				colors[i] = sc.nextInt();
			}
			
			boolean[][] cover = new boolean[n][n];
			
			for(int upper = 0; upper < n; upper++){
				for(int lower = upper + 1; lower < n; lower++){
					final int x_diff = (x_pos[upper] - x_pos[lower]);
					final int y_diff = (y_pos[upper] - y_pos[lower]);
					final int r_diff = (rs[upper] + rs[lower]);
					
					if(x_diff * x_diff + y_diff * y_diff < r_diff * r_diff){
						cover[upper][lower] = true;
					}
				}
			}
			
			final int bit_max = 1 << n;
			
			int[] dp = new int[bit_max];
			Arrays.fill(dp, -1);
			dp[0] = 0;
			
			int max = 0;
			for(int bit = 0; bit < bit_max; bit++){
				if(dp[bit] < 0){
					continue;
				}else{
					max = Math.max(max, dp[bit]);
				}
				
				//System.out.println(dp[bit]);
				
				for(int left = 0; left < n; left++){
					if((bit & (1 << left)) != 0){
						continue;
					}else if(is_covered(left, bit, cover)){
						continue;
					}
					//System.out.println("come");
					
					for(int right = left + 1; right < n; right++){
						if((bit & (1 << right)) != 0){
							continue;
						}else if(is_covered(right, bit, cover)){
							continue;
						}else if(colors[left] != colors[right]){
							continue;
						}
						
						final int next_bit = ((bit | (1 << left)) | (1 << right));
						//System.out.println(next_bit);
						
						dp[next_bit] = Math.max(dp[next_bit], dp[bit] + 2);
					}
				}
			}
			
			System.out.println(max);
		}
	}
}

Compiler output:
Main.java:6: error: class D is public, should be declared in a file named D.java
public class D {
       ^
1 error
Language: Java

import java.awt.geom.Point2D;
import java.util.*;

import static java.lang.Math.*;
public class Main {
	final Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		new Main().init();
	}
	void init(){
		new AOJ1175();
	}
	final int INF=1<<28;
	
	class AOJ1175{
		AOJ1175(){
			ccc = new Circle[25][2];
			while(sc.hasNext()){
				N=sc.nextInt();
				if(N==0)	break;
				solve();
			}
		}
		Circle[] c;
		Circle[][] ccc;
		int N;
		void solve(){
			c=new Circle[N];
			for(int i=0; i<N; ++i)	c[i]=new Circle(sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()-1);
			
			System.out.println(dfs(c, 0));
		}
		int dfs(Circle[] c,int depth){
//			System.out.println(depth+" "+Arrays.toString(c));
			int ret=0;
			for(int i=0; i<N; ++i)if(c[i]==null)	++ret;
			ArrayList<ArrayList<Integer>> list=list(c);
//			System.out.println(depth+" "+list);
			for(int i=0; i<4; ++i){
				if(list.get(i).size() >= 2){
					int n=list.get(i).size(), b=(1<<n)-1;
					for(int j=3; j<=b; ++j)if(Integer.bitCount(j)==2){
						for(int k=0,l=0; k<n; ++k)if((j&(1<<k))>0){
							ccc[depth][l++]=c[list.get(i).get(k)];
							c[list.get(i).get(k)]=null;
						}
						ret = max(ret, dfs(c, depth+1));
						for(int k=0,l=0; k<n; ++k)if((j&(1<<k))>0)	c[list.get(i).get(k)]=ccc[depth][l++];
					}
				}
			}
			return ret;
		}
		ArrayList<ArrayList<Integer>> list(Circle[] c){
			ArrayList<ArrayList<Integer>> ret=new ArrayList<ArrayList<Integer>>(4);
			for(int i=0; i<4; ++i)	ret.add(new ArrayList<Integer>());
			for(int i=0; i<N; ++i)if(c[i]!=null){
				boolean flg=true;
				for(int j=0; j<i; ++j)if(c[j]!=null){
					flg = (c[i].r+c[j].r) <= (c[i].p.distance(c[j].p));
					if(!flg)	break;
				}
				if(flg)	ret.get(c[i].c).add(i);
			}
			return ret;
		}
		class Circle{
			Point2D p;
			double r;
			int c;
			Circle(double x,double y,double r,int c){
				this.p=new Point2D.Double(x,y);
				this.r=r;
				this.c=c;
			}
			@Override
			public String toString() {
				return p.getX()+","+p.getY()+","+r+" "+c;
			}
		}
	}

Compiler output:
Main.java:81: error: reached end of file while parsing
	}
	 ^
1 error
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define max(x,y) x>y?x:y

#define bool int
#define false 0
#define true 1

int n;
int x[111],y[111],r[111],c[111];
bool used[111];
char mem[1<<24];

bool judge(int i,int j){
	bool ok=true;
	rep(k,i){
		if(used[k])continue;
		if(pow(x[i]-x[k],2)+pow(y[i]-y[k],2)<pow(r[i]+r[k],2))ok=false;
	}
	rep(k,j){
		if(used[k])continue;
		if(pow(x[k]-x[j],2)+pow(y[k]-y[j],2)<pow(r[k]+r[j],2))ok=false;
	}
	return ok;
}

int dfs(int v){
	if(mem[v]!=-1)return mem[v];
	int res=0;
	rep(i,n)repl(j,i+1,n){
		if(!used[i]&&!used[j]&&c[i]==c[j]&&judge(i,j)){
			used[i]=used[j]=true;
			res=max(res,dfs(v|(1<<i)|(1<<j))+2);
			used[i]=used[j]=false;
		}
	}
	return mem[v]=res;
}

int main(){
	//cin.sync_with_stdio(false);
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		rep(i,n)scanf("%d%d%d%d",x+i,y+i,r+i,c+i);
		memset(used,0,sizeof(used));
		memset(mem,-1,sizeof(mem));
		printf("%d\n", dfs(0));
	}
	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/cchfwFLn.o: in function `judge':
main.c:(.text+0x8f): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0xe7): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x148): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x1f1): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x249): undefined reference to `pow'
/usr/bin/ld: /tmp/cchfwFLn.o:main.c:(.text+0x2aa): more undefined references to `pow' follow
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#include <math.h>
#define REP(i, a, n) for(int i = (a); i < (n); i++)

int N, X[24], Y[24], R[24], C[24];
int r[24], m[24];
char dp[16777216];

int f(char n, int s) { return ((s & r[n]) & m[n]) == 0; }
char max(char a, char b) { return a > b ? a : b; }

char dfs(int s, char n) {
  if(n == N) return N;

  char ret = n;
  REP(i, 0, N) {
    int mi = (1 << i);
    if((~s & mi) || !f(i, s)) continue;
    REP(j, i + 1, N) {
      int mj = (1 << j);
      if(C[i] != C[j] || (~s & mj) || !f(j, s)) continue;
      int ns = ~(~s | mi | mj);
      if(dp[ns] >= 0) continue;
      ret = max(ret, dfs(ns, n + 2));
    }
  }

  return dp[s] = ret;
}

int main(void) {
  m[0] = 0;
  REP(i, 0, 23) m[i + 1] = m[i] | (1 << i);
  while(scanf("%d", &N), N) {
    REP(i, 0, N) scanf("%d %d %d %d", X + i, Y + i, R + i, C + i);
    REP(i, 0, pow(2, N)) dp[i] = -1;
    REP(i, 0, N) r[i] = 0;
    REP(i, 0, N) REP(j, 0, N) {
      if(pow(R[i] + R[j], 2) > pow(X[i] - X[j], 2) + pow(Y[i] - Y[j], 2)) {
        r[i] = r[i] | (1 << j);
        r[j] = r[j] | (1 << i);
      }
    }
    printf("%d\n", dfs((1 << N) - 1, 0));
  }
  return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccekeyV4.o: in function `main':
main.c:(.text+0x33f): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x3ee): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x446): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x49e): undefined reference to `pow'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
struct A {
    int x;
    int y;
    int r;
    int c;
}a[30];
char dp[1<<25];
int n;
inline bool cover(int qq,int x) {
    int tmp,i;
    for(i=qq-1;i>=0;i--) {
        if(((x>>i)&1)==0) continue;
        tmp=(a[qq].x-a[i].x)*(a[qq].x-a[i].x)+(a[qq].y-a[i].y)*(a[qq].y-a[i].y);
        if((a[qq].r+a[i].r)*(a[qq].r+a[i].r)>tmp) break;
    }
    return i!=-1;
}
char maxnum(char x) {
    if(dp[x]!=-1) return dp[x];
    int i,j,k,tmp;
    char ans=0,y;
    for(i=0;i<n;i++) {
        if(((x>>i)&1)==0) continue;
        if(cover(i,x)) continue;
        for(j=i+1;j<n;j++) {
            if(((x>>j)&1)==0) continue;
            if(a[i].c!=a[j].c) continue;
            if(cover(j,x)) continue;
            y=x-(1<<i)-(1<<j);
            tmp=maxnum(y)+2;
            if(ans<tmp) ans=tmp;
        }
    }
    dp[x]=ans;
    return ans;
}
int main() {
    int i;
    while(scanf("%d",&n),n) {
        for(i=0;i<n;i++) {
            scanf("%d %d %d %d",&a[i].x,&a[i].y,&a[i].r,&a[i].c);
            dp[1<<i]=0;
        }
        for(i=0;i<(1<<n);i++)
            dp[i]=-1;
        dp[0]=0;
        printf("%d\n",maxnum((1<<n)-1));
    }
    return 0;
}

Compiler output:
main.c:10:8: error: unknown type name 'bool'
   10 | inline bool cover(int qq,int x) {
      |        ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | struct A {
Language: C

#include<iostream>
#include<fstream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<ctime>
#include<cstring>
#include<climits>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<set>
#include<algorithm>
#include<stack>
#include<deque>
#include<list>
#include<vector>
#define LL long long
/*
#ifdef unix
#define INT64 "%lld"
#else
#define INT64 "%I64d"
#endif
*/
using namespace std;
int n,m,cnt,snt,K,times;
LL oo=1000000007;
struct dic
{
	int x,y,r;
	int c;
}p[110];
int num[110];
int ans;
bool vis[110];
bool f[16777216];
int dis(int x1,int y1,int x2,int y2)
{
	return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
bool cover(int pos,int state)
{
	for (int i=1;i<pos;i++)
	if (((state>>(i-1))&1)&&dis(p[i].x,p[i].y,p[pos].x,p[pos].y)<(p[i].r+p[pos].r)*(p[i].r+p[pos].r)) 
	return true;
	return false;
}
void dp(int state)
{
	int sum=0;
	for (int i=0;i<n;i++) if ((state>>i)&1) sum++;
	ans=max(ans,n-sum);
	if (f[state]) return;
	f[state]=true;
	for (int i=1;i<=n;i++)
	if (((state>>(i-1))&1)&&!cover(i,state))
	for (int j=i+1;j<=n;j++)
	if (((state>>(j-1))&1)&&p[i].c==p[j].c&&!cover(j,state))
	{
		int tstate=state^(1<<(i-1))^(1<<(j-1));
		dp(tstate);
	}
}
void work()
{
	memset(p,0,sizeof(p));
	for (int i=1;i<=n;i++)
	scanf("%d%d%d%d",&p[i].x,&p[i].y,&p[i].r,&p[i].c);
	ans=0;
	memset(f,0,sizeof(f));
	dp((1<<n)-1);
	printf("%d\n",ans);
}
int main()
{
	scanf("%d",&n);
	while (n!=0)
	{
		work();
		scanf("%d",&n);
	}
    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

def xx(x):
    return x * x
    
def pop(overlaps, i, lis):
    for k in lis:
        if i > k and overlaps[i][k]: return False
    return True

def search(disks, overlaps, lis):
    if len(lis) < 2: return 0
    res = 0
    for i in lis:
        if not pop(overlaps, i, lis): continue
        #print("OK", i)
        for k in lis:
            if i == k: continue
            if disks[i][3] != disks[k][3]: continue
            if not pop(overlaps, k, lis): continue
            #print("Good", k)
            giv = list(lis)
            giv.remove(i)
            giv.remove(k)
            res = max(res, 2 + search(disks, overlaps, giv))
    return res

while True:
    n = int(input())
    if n == 0: break
    disks = [
        list(map(int, input().split(" ")))
        for _ in range(n)
    ]
    
    overlaps = []
    for i in range(n):
        res = []
        for k in range(n):
            a = disks[i]; b = disks[k]
            res.append(xx(a[0] - b[0]) + xx(a[1] - b[1]) < xx(a[2] + b[2]))
        overlaps.append(res)
    #print(overlaps)

    print(search(disks, overlaps, list(range(n))))
          


Compiler output:
a.cc:14:10: error: invalid preprocessing directive #print
   14 |         #print("OK", i)
      |          ^~~~~
a.cc:19:14: error: invalid preprocessing directive #print
   19 |             #print("Good", k)
      |              ^~~~~
a.cc:41:6: error: invalid preprocessing directive #print
   41 |     #print(overlaps)
      |      ^~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def xx(x):
      | ^~~
a.cc:38:27: error: 'b' does not name a type
   38 |             a = disks[i]; b = disks[k]
      |                           ^
Language: C++

int n; //枚数
int x[25],y[25],r[25],c[25]; //円盤
int b[25]; //各円盤の上に重なっている円盤（ビット管理）

//円盤iと円盤jが重なっているかの判定
bool intersects(int i,int j){
  int dist1 = pow(x[i]-x[j],2) + pow(y[i]-y[j],2);
  int dist2 = pow(r[i]+r[j],2);

  return dist2 > dist1;
}

//DP用
char dp[1<<24];

int main(void){
  while(scanf("%d",&n),n){
    rep(i,n){
      scanf("%d%d%d%d",&x[i],&y[i],&r[i],&c[i]);

      //円盤iの上に重なっている円盤を全て探す
      b[i] = 0;
      rep(j,i) if(intersects(i,j)) b[i] |= (1<<j);
    }

    int ans = 0;
    int to = (1<<n);
    memset(dp,-1,sizeof(dp));
    dp[0] = 0;

    rep(i,to){
      if(dp[i] == -1) continue;

      ans = max(ans,(int)dp[i]);

      //消せる円盤のペア(j,k)を探す
      rep(j,n-1){
        //すでに円盤jは消えている or 円盤jの上の円盤が邪魔して消せない
        if((i & (1<<j)) != 0 || (i & b[j]) != b[j]) continue;

        REP(k,j+1,n){
          //jとkの色が違う or すでに円盤kは消えている or 円盤kの上の円盤が邪魔
          if(c[j] != c[k] || (i & (1<<k)) != 0 || (i & b[k]) != b[k]) continue;

          int next = i | (1<<j) | (1<<k); //next = 円盤jとkを消した状態(ビット管理)
          dp[next] = max((int)dp[next],dp[i]+2);
        }
      }
    }

    printf("%d\n",ans);
  }
}


Compiler output:
a.cc: In function 'bool intersects(int, int)':
a.cc:7:15: error: 'pow' was not declared in this scope
    7 |   int dist1 = pow(x[i]-x[j],2) + pow(y[i]-y[j],2);
      |               ^~~
a.cc: In function 'int main()':
a.cc:17:9: error: 'scanf' was not declared in this scope
   17 |   while(scanf("%d",&n),n){
      |         ^~~~~
a.cc:18:9: error: 'i' was not declared in this scope
   18 |     rep(i,n){
      |         ^
a.cc:18:5: error: 'rep' was not declared in this scope
   18 |     rep(i,n){
      |     ^~~
a.cc:28:5: error: 'memset' was not declared in this scope
   28 |     memset(dp,-1,sizeof(dp));
      |     ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int n; //枚数
a.cc:51:5: error: 'printf' was not declared in this scope
   51 |     printf("%d\n",ans);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int n; //枚数
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<vector>
#include<complex>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cctype>
#include<cstring>
#include<cassert>
int n; //枚数
int x[25],y[25],r[25],c[25]; //円盤
int b[25]; //各円盤の上に重なっている円盤（ビット管理）

//円盤iと円盤jが重なっているかの判定
bool intersects(int i,int j){
  int dist1 = pow(x[i]-x[j],2) + pow(y[i]-y[j],2);
  int dist2 = pow(r[i]+r[j],2);

  return dist2 > dist1;
}

//DP用
char dp[1<<24];

int main(void){
  while(scanf("%d",&n),n){
    rep(i,n){
      scanf("%d%d%d%d",&x[i],&y[i],&r[i],&c[i]);

      //円盤iの上に重なっている円盤を全て探す
      b[i] = 0;
      rep(j,i) if(intersects(i,j)) b[i] |= (1<<j);
    }

    int ans = 0;
    int to = (1<<n);
    memset(dp,-1,sizeof(dp));
    dp[0] = 0;

    rep(i,to){
      if(dp[i] == -1) continue;

      ans = max(ans,(int)dp[i]);

      //消せる円盤のペア(j,k)を探す
      rep(j,n-1){
        //すでに円盤jは消えている or 円盤jの上の円盤が邪魔して消せない
        if((i & (1<<j)) != 0 || (i & b[j]) != b[j]) continue;

        REP(k,j+1,n){
          //jとkの色が違う or すでに円盤kは消えている or 円盤kの上の円盤が邪魔
          if(c[j] != c[k] || (i & (1<<k)) != 0 || (i & b[k]) != b[k]) continue;

          int next = i | (1<<j) | (1<<k); //next = 円盤jとkを消した状態(ビット管理)
          dp[next] = max((int)dp[next],dp[i]+2);
        }
      }
    }

    printf("%d\n",ans);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'i' was not declared in this scope
   34 |     rep(i,n){
      |         ^
a.cc:34:5: error: 'rep' was not declared in this scope
   34 |     rep(i,n){
      |     ^~~
Language: C++

#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

constexpr int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
constexpr int dy[8] = { 0,1,1,1,0,-1,-1,-1 };


using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	while (cin >> n, n) {
		vvi color(4);
		vi x(n), y(n), r(n), c(n);
		REP(i, n) {
			cin >> x[i] >> y[i] >> r[i] >> c[i];
			c[i]--;
			color[c[i]].push_back(i);
		}
		vi b(1 << n, 0);
		b[(1 << n) - 1] = 1;
		vvi g(n);
		vi d(n, 0);
		REP(i, n)FOR(j, i + 1, n) {
			if ((x[i] - x[j])*(x[i] - x[j]) + (y[i] - y[j])*(y[i] - y[j]) < (r[i] + r[j])*(r[i] + r[j])) {
				g[i].push_back(j);
				d[j]++;
			}
		}
		queue<int> q;
		q.push((1 << n) - 1);
		while (!q.empty()) {
			int bit = q.front(); q.pop();

			vi a = d;
			REP(i, n) {
				if ((bit&(1 << i)) == 0) {
					REP(j, g[i].size()) {
						a[g[i][j]]--;
					}
				}
			}
			REP(i, n)REP(j, i + 1, n) {
				if (c[i] == c[j] && (bit&(1 << i)) && (bit&(1 << j)) && a[i] == 0 && a[j] == 0) {
					if (b[bit ^ i ^ j] == 0)q.push(bit ^ i ^ j);
					b[bit ^ i ^ j] = 1;
				}
			}
		}
		int ans = 0;
		REP(i, 1 << n) {
			if (b[i] == 0)continue;
			int cnt = n;
			REP(j, n)if (i&(1 << j))cnt--;
			chmax(ans, cnt);
		}
		cout << ans << endl;
	}
}


Compiler output:
a.cc:65:49: error: macro "REP" passed 3 arguments, but takes just 2
   65 |                         REP(i, n)REP(j, i + 1, n) {
      |                                                 ^
a.cc:3:9: note: macro "REP" defined here
    3 | #define REP(i,n) for(ll i=0;i<ll(n);++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:65:34: error: 'REP' was not declared in this scope
   65 |                         REP(i, n)REP(j, i + 1, n) {
      |                                  ^~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

#define For(i,a,b)  for(int i = a;i < b;i++)
#define rep(i,n)	For(i,0,n)
#define all(n)		n.begin(),n.end()

//(x + a)^2 + (y + b)^2 <= c

struct Circle{
	int x, y, r;
	int c;
	Circle(){};
	Circle(int x, int y, int r, int c) :x(x), y(y), r(r), c(c){}
	int inter(Circle cl){
		int tx = cl.x, ty = cl.y;
		int t = (x - tx)*(x - tx) + (y - ty)*(y - ty);
		int R = (r + cl.r)*(r + cl.r);
		if (t < R)return 1;
		if (t >= R)return 0;
	}
};

int n;

int dfs(vector<Circle> v){

	vector<int> tv[5];
	rep(i, v.size()){
		bool tf = true;
		For(j,i+1, v.size()){
			if (v[i].inter(v[j]) == 1){
				tf = false;
			}
		}
		if (tf){
			tv[v[i].c].push_back(i);
		}
	}

	int ret = 0;
	bool f = false;

	rep(i, 5){
		if (tv[i].size() >= 2){
			if (tv[i].size() % 2){
				rep(j, tv[i].size()){
					For(k, j + 1, tv[i].size()){
						vector<Circle> tmpv;

						rep(l, v.size()){
							if (tv[i][j] != l && tv[i][k] != l)
								tmpv.push_back(v[l]);
						}

						ret = max(ret, dfs(tmpv));
					}
				}
				f = true;
				break;
			}
			else{
				vector<Circle> tmpv;
				bool cf[100]; memset(cf, 0, sizeof cf);
				rep(j, tv[i].size()){
					cf[tv[i][j]] = true;
				}
				rep(j, v.size()){
					if (!cf[j])
					tmpv.push_back(v[j]);
				}
				ret = max(ret, dfs(tmpv));
				f = true;
				break;
			}
		}
	}

	if (!f){
		return n - v.size();
	}
	
	return ret;
}


int main()
{

	while (cin >> n && n){

		vector<Circle> v;
		rep(i, n){
			int x, y, r, c;
			cin >> x >> y >> r >> c;
			v.push_back(Circle(x, y, r, c));
		}

		reverse(all(v));

		cout << dfs(v) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int dfs(std::vector<Circle>)':
a.cc:68:47: error: 'memset' was not declared in this scope
   68 |                                 bool cf[100]; memset(cf, 0, sizeof cf);
      |                                               ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 | 
a.cc: In member function 'int Circle::inter(Circle)':
a.cc:25:9: warning: control reaches end of non-void function [-Wreturn-type]
   25 |         }
      |         ^
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[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-bit_count[bit];

    for(int i=0;i<n;i++){
        if(((bit>>i)&1)==0||ok(i,bit)==false)continue;
        for(int j=i+1;j<n;j++){
            if((bit>>j)&1)==0||ok(j,bit)==false||c[i]!=c[j])continue;
            int to_bit=(bit^(1<<i))^(1<<j);
            if(!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: In function 'int dfs(int)':
a.cc:27:27: error: expected primary-expression before '==' token
   27 |             if((bit>>j)&1)==0||ok(j,bit)==false||c[i]!=c[j])continue;
      |                           ^~
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[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: In function 'void init()':
a.cc:56:13: error: 'bit_count' was not declared in this scope
   56 |             bit_count[i]++;
      |             ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct circle{
  double x, y, r;
  int c;
  unordered_set<int> overlap;
};

void calcOverlap(int n, circle *disk){
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int x = disk[i].x - disk[j].x, y = disk[i].y - disk[j].y;
      if(sqrt(x*x + y*y) + 1e-8< disk[i].r + disk[j].r){
        disk[j].overlap.insert(i);
      }
    }
  }
}

int dfs(int n, circle *disk, bool *removed, int dep = 0){
  int res = 0;
  bool f = false;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if(removed[i] == true or removed[j] == true)continue;
      if(disk[i].c != disk[j].c)continue;
      if(disk[i].overlap.empty() and disk[j].overlap.empty()){
        f = true;
        removed[i] = true;
        removed[j] = true;
        for (int k = 0; k < n; k++) {
          disk[k].overlap.erase(i);
          disk[k].overlap.erase(j);
        }
        res = max(res, dfs(n, disk, removed, dep + 1));
      }
    }
  }
  return f?res:dep;
}

int main(int argc, char *argv[]){
  int n;
  while(cin >> n, n){
    circle disk[n];
    for (int i = 0; i < n; i++) {
      cin >> disk[i].x >> disk[i].y >> disk[i].r >> disk[i].c;
    }
    calcOverlap(n, disk);
    // for (int i = 0; i < n; i++) {
    //   std::cout << "i:" << i << std::endl;
    //   for (int j :disk[i].overlap) {
    //     std::cout << j << " ";
    //   }
    //   std::cout << std::endl;
    // }
    bool removed[n];
    memset(removed, false, sizeof(removed));
    std::cout << 2*dfs(n, disk, removed) << std::endl;
    // }
  
    return 0;
  }

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:63:4: error: expected '}' at end of input
   63 |   }
      |    ^
a.cc:42:33: note: to match this '{'
   42 | int main(int argc, char *argv[]){
      |                                 ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999


struct cir{
    int x,y,r,c;
};

bool same(cir a,cir b){
    double r2 = (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
    if((a.r+b.r)*(a.r+b.r)>r2)return true;
    else return false;
}

bool used(int n,vi vec){
    rep(i,vec.size()){
        int to = vec[i];
        if( (n&(1<<to)) != 0 )return false;
    }
    return true;
}

int main(){
    int n;
    while(cin>>n){
        if(n==0)break;
        vector<cir> data;
        
        rep(i,n){
            int x,y,r,c;
            cin>>x>>y>>r>>c;
            data.pb(cir{x,y,r,c});
        }
        
        
        vector<int> G[30];
        
        for(int i=data.size()-1;i>=0;i--){
            for(int j=i-1;j>=0;j--){
                if(same(data[i],data[j])){
                    G[i].pb(j);
                }
            }
        }
        
        static bool dp[1<<n];
        rep(i,1<<n)dp[i]=false;
        dp[(1<<n)-1]=true;
        
        
        for(int i=(1<<n)-1;i>=0;i--){
            if(dp[i]==false)continue;
            rep(j,n){
                for(int k=j+1;k<n;k++){
                    if( (i&(1<<j) )==0 || (i&(1<<k) )==0)continue;
                    if( data[j].c==data[k].c && used(i,G[j]) && used(i,G[k]) ) dp[(i^(1<<j))^(1<<k)] = true;
                }
            }
        }
        
        int ans=100;
        for(int i=(1<<n)-1;i>=0;i--){
            if(dp[i]==false)continue;
            ans = min(ans,__builtin_popcount(i));
        }
        cout<<n-ans<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:21: error: storage size of 'dp' isn't constant
   53 |         static bool dp[1<<n];
      |                     ^~
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999


struct cir{
    int x,y,r,c;
};

bool same(cir a,cir b){
    double r2 = (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
    if((a.r+b.r)*(a.r+b.r)>r2)return true;
    else return false;
}

bool used(int n,vi vec){
    rep(i,vec.size()){
        int to = vec[i];
        if( (n&(1<<to)) != 0 )return false;
    }
    return true;
}

bool dp[1<<n];

int main(){
    int n;
    while(cin>>n){
        if(n==0)break;
        vector<cir> data;
        
        rep(i,n){
            int x,y,r,c;
            cin>>x>>y>>r>>c;
            data.pb(cir{x,y,r,c});
        }
        
        
        vector<int> G[30];
        
        for(int i=data.size()-1;i>=0;i--){
            for(int j=i-1;j>=0;j--){
                if(same(data[i],data[j])){
                    G[i].pb(j);
                }
            }
        }
        
        
        rep(i,1<<n)dp[i]=false;
        dp[(1<<n)-1]=true;
        
        
        for(int i=(1<<n)-1;i>=0;i--){
            if(dp[i]==false)continue;
            rep(j,n){
                for(int k=j+1;k<n;k++){
                    if( (i&(1<<j) )==0 || (i&(1<<k) )==0)continue;
                    if( data[j].c==data[k].c && used(i,G[j]) && used(i,G[k]) ) dp[(i^(1<<j))^(1<<k)] = true;
                }
            }
        }
        
        int ans=100;
        for(int i=(1<<n)-1;i>=0;i--){
            if(dp[i]==false)continue;
            ans = min(ans,__builtin_popcount(i));
        }
        cout<<n-ans<<endl;
    }
}

Compiler output:
a.cc:30:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   30 | bool dp[1<<n];
      |            ^
      |            yn
a.cc: In function 'int main()':
a.cc:56:20: error: 'dp' was not declared in this scope; did you mean 'dup'?
   56 |         rep(i,1<<n)dp[i]=false;
      |                    ^~
      |                    dup
a.cc:57:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
   57 |         dp[(1<<n)-1]=true;
      |         ^~
      |         dup
Language: C++

#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int n, x[26], y[26], r[26], col[26], b[26][26]; short dp[16777222];
int solve(int bit) {
	if (dp[bit]) return dp[bit] - 1;
	int ret = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (col[i] != col[j]) continue
			if ((bit & b[i][j]) == b[i][j]) {
				int res = solve(bit + (1 << i) + (1 << j));
				ret = max(ret, res + 2);
			}
		}
	}
	dp[bit] = ret + 1;
	return ret;
}
int main() {
	while (cin >> n, n) {
		for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> r[i] >> col[i];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				b[i][j] = 0;
				for (int k = 0; k < n; k++) {
					int disti = (x[k] - x[i]) * (x[k] - x[i]) + (y[k] - y[i]) * (y[k] - y[i]);
					int distj = (x[k] - x[j]) * (x[k] - x[j]) + (y[k] - y[j]) * (y[k] - y[j]);
					if (k < i && disti < (r[i] + r[k]) * (r[i] + r[k])) b[i][j] |= 1 << k;
					if (k < j && distj < (r[j] + r[k]) * (r[j] + r[k])) b[i][j] |= 1 << k;
				}
			}
		}
		fill(dp, dp + (1 << n), 0);
		int ret = solve(0);
		cout << ret << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int solve(int)':
a.cc:11:55: error: expected ';' before 'if'
   11 |                         if (col[i] != col[j]) continue
      |                                                       ^
      |                                                       ;
   12 |                         if ((bit & b[i][j]) == b[i][j]) {
      |                         ~~
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

struct Circle {
    short x;
    short y;
    short r;
    short c;
};

bool overwrap(const Circle& c1, const Circle& c2)
{
    const short d = c1.r + c2.r;
    const short R = (c1.x - c2.x) * (c1.x - c2.x) + (c1.y - c2.y) * (c1.y - c2.y);
    return d * d > R;
}

short n;
short dp(vector<short>& table, const vector<vector<bool>>& wrap, const short state, const vector<Circle>& circle)
{
    if (table[state] != -1) {
        return table[state];
    } else {
        vector<short> sub(4, 0);
        vector<vector<short>> top(4, vector<short>(0));
        for (short j = 0; j < n; j++) {
            if (state & (1 << j)) {
                bool ok = true;
                for (short i = 0; i < j; i++) {
                    if (state & (1 << i)) {
                        if (wrap[i][j]) {
                            ok = false;
                            break;
                        }
                    }
                }
                if (ok) {
                    sub[circle[j].c] += (1 << j);
                    top[circle[j].c].push_back(j);
                }
            }
        }
        for (short i = 0; i < 4; i++) {
            const short size = top[i].size();
            if (size <= 1) {
                continue;
            }
            if (size % 2 == 0) {
                const short val = dp(table, wrap, state - sub[i], circle);
                table[state] = val + size;
                return val + size;
            } else {
                short maxi = 0;
                for (short j = 0; j < size; j++) {
                    const short val = dp(table, wrap, state - sub[i] + (1 << top[i][j]), circle);
                    maxi = max(maxi, val);
                }
                table[state] = maxi + (size / 2 * 2);
                return maxi + (size / 2 * 2);
            }
        }
        table[state] = 0;
        return 0;
    }
}

short main()
{
    while (true) {
        cin >> n;
        if (n == 0) {
            break;
        }
        vector<Circle> circle(n);
        for (short i = 0; i < n; i++) {
            short x, y, r;
            short c;
            cin >> x >> y >> r >> c;
            c--;
            circle[i] = Circle{x, y, r, c};
        }

        vector<vector<bool>> wrap(n, vector<bool>(n, false));  // j?????????i?????????
        for (short i = 0; i < n; i++) {
            for (short j = i + 1; j < n; j++) {
                wrap[i][j] = overwrap(circle[i], circle[j]);
            }
        }

        const short maximum = 1 << n;
        vector<short> table(maximum, -1);
        table[0] = 0;
        cout << dp(table, wrap, maximum - 1, circle) << endl;
    }
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

nt n; //枚数
int x[25],y[25],r[25],c[25]; //円盤
int b[25]; //各円盤の上に重なっている円盤（ビット管理）

//円盤iと円盤jが重なっているかの判定
bool intersects(int i,int j){
  int dist1 = pow(x[i]-x[j],2) + pow(y[i]-y[j],2);
  int dist2 = pow(r[i]+r[j],2);

  return dist2 > dist1;
}

//DP用
char dp[1<<24];

int main(void){
  while(scanf("%d",&n),n){
    rep(i,n){
      scanf("%d%d%d%d",&x[i],&y[i],&r[i],&c[i]);

      //円盤iの上に重なっている円盤を全て探す
      b[i] = 0;
      rep(j,i) if(intersects(i,j)) b[i] |= (1<<j);
    }

    int ans = 0;
    int to = (1<<n);
    memset(dp,-1,sizeof(dp));
    dp[0] = 0;

    rep(i,to){
      if(dp[i] == -1) continue;

      ans = max(ans,(int)dp[i]);

      //消せる円盤のペア(j,k)を探す
      rep(j,n-1){
        //すでに円盤jは消えている or 円盤jの上の円盤が邪魔して消せない
        if((i & (1<<j)) != 0 || (i & b[j]) != b[j]) continue;

        REP(k,j+1,n){
          //jとkの色が違う or すでに円盤kは消えている or 円盤kの上の円盤が邪魔
          if(c[j] != c[k] || (i & (1<<k)) != 0 || (i & b[k]) != b[k]) continue;

          int next = i | (1<<j) | (1<<k); //next = 円盤jとkを消した状態(ビット管理)
          dp[next] = max((int)dp[next],dp[i]+2);
        }
      }
    }

    printf("%d\n",ans);
  }
}


Compiler output:
a.cc:1:1: error: 'nt' does not name a type; did you mean 'int'?
    1 | nt n; //枚数
      | ^~
      | int
a.cc: In function 'bool intersects(int, int)':
a.cc:7:15: error: 'pow' was not declared in this scope
    7 |   int dist1 = pow(x[i]-x[j],2) + pow(y[i]-y[j],2);
      |               ^~~
a.cc: In function 'int main()':
a.cc:17:21: error: 'n' was not declared in this scope
   17 |   while(scanf("%d",&n),n){
      |                     ^
a.cc:17:9: error: 'scanf' was not declared in this scope
   17 |   while(scanf("%d",&n),n){
      |         ^~~~~
a.cc:18:9: error: 'i' was not declared in this scope
   18 |     rep(i,n){
      |         ^
a.cc:18:5: error: 'rep' was not declared in this scope
   18 |     rep(i,n){
      |     ^~~
a.cc:28:5: error: 'memset' was not declared in this scope
   28 |     memset(dp,-1,sizeof(dp));
      |     ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | nt n; //枚数
a.cc:51:5: error: 'printf' was not declared in this scope
   51 |     printf("%d\n",ans);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | nt n; //枚数
Language: C++

import java.util.*;

import javax.swing.Box.Filler;

public class Main {
	Coin[] coins;
	Scanner sc = new Scanner(System.in);
	boolean[] lapped;
	int n;
	int[] state;
	
	void run() {
		while (true) {
			n = sc.nextInt();
			if( n == 0 ) break;
			coins = new Coin[n];
			lapped = new boolean[n];
			for(int i=0;i<n;i++) coins[i] = new Coin();
			int S=(1<<n)-1;
			state = new int[1<<n];
			for(int i=0;i<(1<<n);i++) state[i] = -1;
			System.out.println(solve(S));
		}
	}
	
	int solve( int S ) {
//		System.out.println(S);
		if( S == 0 ) return 0;
		if (state[S] >= 0) return state[S];
		analyseLapped(S);
//		for(int i=0;i<n;i++) System.out.print(lapped[i] + " ");
//		System.out.println();
//		sc.next();
		int cnt = 0;
		for(int i=0;i<n;i++) {
			if( ((S>>i) & 1) != 1 || lapped[i] ) continue;
			for(int j=i+1;j<n;j++) {
				if ( ((S>>j) & 1) == 1 && !lapped[j] && coins[i].c == coins[j].c ) {
					cnt = Math.max(cnt, solve(S-((1<<i) + (1<<j)))+2);
				}
			}
		}
		return state[S] = cnt;
	}
	
	void analyseLapped(int S) {
		for(int i=0;i<n;i++) lapped[i] = false;
		for(int i=0;i<n;i++) {
//			System.out.println( (S>>i) & 1 );
			if( ((S>>i) & 1) != 1 ) continue;
			for(int j=i+1;j<n;j++) {
				if( ((S>>j) & 1) != 1 ) continue;
//				System.out.println(coins[i].isLapped(coins[j]));
				if( coins[i].isLapped(coins[j]) ) lapped[j] = true;
			}
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
	
	protected class Coin {
		int x, y, r, c;
		
		public Coin() {
			scan();
		}
		
		void scan() {
			x = sc.nextInt();
			y = sc.nextInt();
			r = sc.nextInt();
			c = sc.nextInt();
		}
		
		boolean isLapped( Coin c ) {
			return (c.x-x)*(c.x-x)+(c.y-y)*(c.y-y) < (r+c.r)*(r+c.r);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import javax.swing.Box.Filler;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~