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

#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;
struct Point { long double px, py; };
struct Circle { Point p; long double r; };
Point pol(long double r, long double d) { return Point{ cosl(d) * r, sinl(d) * r }; }
long double arg(const Point& a) { return atan2l(a.py, a.px); }
long double norm(const Point& a) { return a.px * a.px + a.py * a.py; }
long double abs(const Point& a) { return sqrtl(norm(a)); }
inline Point Minus(Point a, Point b) { return Point{ a.px - b.px,a.py - b.py }; }
inline Point Plus(Point a, Point b) { return Point{ a.px + b.px,a.py + b.py }; }
long double dst(const Point& a, const Point& b) { return abs(Minus(b, a)); }
pair<Point, Point> crp(Circle c1, Circle c2) {
    double d = abs(Minus(c1.p, c2.p));
    double a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
    double t = arg(Minus(c2.p, c1.p));
    return make_pair(Plus(c1.p, pol(c1.r, t + a)), Plus(c1.p, pol(c1.r, t - a)));
}
int main() {
    Circle x[100]; int n;
    while (true) {
        cin >> n; char ch; if (n == 0)break;
        for (int i = 0; i < n; i++) { cin >> x[i].p.px >> ch >> x[i].p.py; x[i].r = 1.0l; }
        int ret = 0;
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
            	vector<Point> z = crp(x[i], x[j]);
            	for(int k = 0; k < 2; k++) {
            		int cnt = 0;
            		for(int l = 0; l < n; l++) {
            			if(dst(z[k], x[l].p) <= 1.0L) cnt++;
            		}
            		ret = max(ret, cnt);
            	}
            }
        }
        cout << ret << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:38: error: conversion from 'std::pair<Point, Point>' to non-scalar type 'std::vector<Point>' requested
   29 |                 vector<Point> z = crp(x[i], x[j]);
      |                                   ~~~^~~~~~~~~~~~
Language: C++

#include <cstdio>
#include <vector>
#include <complex>
using namespace std;

#define EPS 1e-8
#define EQ(x, y) (abs((x)-(y)) < EPS)

typedef complex<double> Point;

struct Circle {
  Point c;
  double r;
};

int n;
Circle cs[100000];

vector<Point> CrossPointCC(Circle a, Circle b) {
  vector<Point> ret;
  double d = abs(b.c-a.c);
  double rc = (d*d + a.r*a.r - b.r*b.r) / (2*d);
  double dfr = a.r*a.r - rc*rc;
  if (EQ(dfr, 0.0)) dfr = 0.0;
  else if (dfr < 0.0) return ret;

  double rs = sqrt(dfr);

  Point sgn = (b.c-a.c) / d;
  ret.push_back(a.c + sgn * Point(rc, rs));
  if (dfr > 0.0) {
    ret.push_back(b.c + sgn * Point(rc, -rs));
  }
  return ret;
}

int main() {
  while (1) {
    scanf("%d", &n);
    if (n == 0) return 0;
    
    for (int i=0; i<n; i++) {
      double x, y;
      scanf("%lf,%lf", &x, &y);
      cs[i] = {Point(x, y), 1.0};
    }

    vector<Point> candidates;
    for (int i=0; i<n; i++) {
      for (int j=i+1; j<n; j++) {
        vector<Point> ps = CrossPointCC(cs[i], cs[j]);
        candidates.insert(candidates.end(), ps.begin(), ps.end());
      }
    }

    int ans = 1;
    for (int i=0; i<candidates.size(); i++) {
      Point p = candidates[i];
      if (p.X < 0.0 || p.X > 10.0) continue;
      if (p.Y < 0.0 || p.Y > 10.0) continue;

      int cnt = 0;
      for (int i=0; i<n; i++) {
        if (abs(cs[i].c-p) < 1.0+EPS) cnt++;
      }

      ans = max(ans, cnt);
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:59:13: error: 'Point' {aka 'class std::complex<double>'} has no member named 'X'
   59 |       if (p.X < 0.0 || p.X > 10.0) continue;
      |             ^
a.cc:59:26: error: 'Point' {aka 'class std::complex<double>'} has no member named 'X'
   59 |       if (p.X < 0.0 || p.X > 10.0) continue;
      |                          ^
a.cc:60:13: error: 'Point' {aka 'class std::complex<double>'} has no member named 'Y'
   60 |       if (p.Y < 0.0 || p.Y > 10.0) continue;
      |             ^
a.cc:60:26: error: 'Point' {aka 'class std::complex<double>'} has no member named 'Y'
   60 |       if (p.Y < 0.0 || p.Y > 10.0) continue;
      |                          ^
Language: C++

#include<iostream>
#include<math.h>
using namespace std;
int n,a[101][101];
double x[101],y[101];
bool used[101];
int dfs(int x){
  int res=1;
  used[x]=1;
  for(int i=0;i<n;i++)
    if(a[x][i]&&(!used[i]))
      res+=dfs(i);
  return res;
}
int main(){
  while(cin>>n,n){
    for(int i=0;i<n;i++)
      scanf("%lf,%lf",&x[i],&y[i]);
    memset(a,0,sizeof(a));
    for(int i=0;i<n;i++)
      for(int j=0;j<n;j++)if(i!=j)
        if(sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))<=2.0)a[i][j]=1;
    memset(used,0,sizeof(used));
    int ans=0;
    for(int i=0;i<n;i++)
         if(!used[i])ans=max(ans,dfs(i));
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'memset' was not declared in this scope
   19 |     memset(a,0,sizeof(a));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<math.h>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<math.h>
using namespace std;
int n,a[101][101];
double x[101],y[101];
bool used[101];
int dfs(int x){
  int res=1;
  used[x]=1;
  for(int i=0;i<n;i++)
    if(a[x][i]&&(!used[i]))
      res+=dfs(i);
  return res;
}
int main(){
  while(cin>>n,n){
    for(int i=0;i<n;i++)
      scanf("%lf,%lf",&x[i],&y[i]);
    memset(a,0,sizeof(a));
    for(int i=0;i<n;i++)
      for(int j=0;j<n;j++)if(i!=j)
        if(sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))<=1.9999999999)a[i][j]=1;
    memset(used,0,sizeof(used));
    int ans=0;
    for(int i=0;i<n;i++)
         if(!used[i])ans=max(ans,dfs(i));
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'memset' was not declared in this scope
   19 |     memset(a,0,sizeof(a));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<math.h>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

import math

def overlap(p1, p2, d):
    return (p1[0] - p2[0])**2 + (p1[1] - p2[1])**2 <= d

def intersection(o1,o2):
    a  = 2*(o2[0] - o1[0])
    b  = 2*(o2[1] - o1[1])
    c  = (o1[0] - o2[0])*(o1[0] + o2[0]) + (o1[1] - o2[1])*(o1[1] + o2[1])
    a2 = a**2 + b**2
    b2 = a*c + a*b*o1[1] - b**2*o1[0]
    c2 = b**2*(o1[0]**2 + o1[1]**2 - 1) + c**2 + 2*b*c*o1[1]
    x1 = (-b2 + math.sqrt(b2**2 - a2*c2))/a2
    x2 = (-b2 - math.sqrt(b2**2 - a2*c2))/a2
    if b == 0:
        y1 = (o1[1] + o2[1])/2
        y2 = (o1[1] + o2[1])/2
    else:
        y1 = -(a*x1 + c)/b
        y2 = -(a*x2 + c)/b
    if b2**2 - a2*c2 < 10e-6:
        return [x1, y1], [None, None]
    else:
        return [x1, y1], [x2, y2]

while True:
    n = int(input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(list(map(float, input().split(","))))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            if not overlap(p[i], p[j], 4):
                continue
            p1, p2 = intersection(p[i], p[j])
            cnt1 = 0
            cnt2 = 0
            for k in range(n):
                if overlap(p1, p[k], 1):
                    cnt1 += 1
                if p2[0] != None and overlap(p2, p[k], 1):
                    cnt2 += 1
            ans = max([ans, cnt1, cnt2])
    print(ans)



Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

import math

def overlap(p1, p2, d):
    return (p1[0] - p2[0])**2 + (p1[1] - p2[1])**2 <= d

def intersection(o1,o2):
    a  = 2*(o2[0] - o1[0])
    b  = 2*(o2[1] - o1[1])
    c  = (o1[0] - o2[0])*(o1[0] + o2[0]) + (o1[1] - o2[1])*(o1[1] + o2[1])
    a2 = a**2 + b**2
    b2 = a*c + a*b*o1[1] - b**2*o1[0]
    c2 = b**2*(o1[0]**2 + o1[1]**2 - 1) + c**2 + 2*b*c*o1[1]
    x1 = (-b2 + math.sqrt(b2**2 - a2*c2))/a2
    x2 = (-b2 - math.sqrt(b2**2 - a2*c2))/a2
    if b == 0:
        y1 = (o1[1] + o2[1])/2
        y2 = (o1[1] + o2[1])/2
    else:
        y1 = -(a*x1 + c)/b
        y2 = -(a*x2 + c)/b
    if b2**2 - a2*c2 < 10e-6:
        return [x1, y1], [None, None]
    else:
        return [x1, y1], [x2, y2]

while True:
    n = int(input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(list(map(float, input().split(","))))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            if not overlap(p[i], p[j], 4):
                continue
            elif overlap(p[i], p[j], 10e-6):
                continue
            p1, p2 = intersection(p[i], p[j])
            print(p1,p2)
            cnt1 = 0
            cnt2 = 0
            for k in range(n):
                if overlap(p1, p[k], 1):
                    cnt1 += 1
                if p2[0] != None and overlap(p2, p[k], 1):
                    cnt2 += 1
            print(ans, cnt1, cnt2)
            ans = max([ans, cnt1, cnt2])
    print(ans)



Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <cstdio>
#include <cmath>
#include <bitset>
using namespace std;
double x[100], y[100];
bitset<100> bits[100];
int main()
{
	int n;
	while (true) {
		scanf("%d", &n);
		if (n == 0) break;
		for (int i = 0; i < n; ++i) scanf("%lf,%lf", &x[i], &y[i]);
		for (int i = 0; i < n; ++i) bits[i].reset();

		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < n; ++j) {
				double d = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]); 
				if (d > 4.0) continue;
				bits[i][j] = 1;
				//if (d <= 4.0000000001) bits[i][j] = 1;
			}
		}

		int res = 0;
		for (int i = 0; i < n; ++i) {
			for (int j = i; j < n; ++j)
				if (bits[i][j]) bits[i] &= bits[j];
			if (res < bits[i].count()) res = bits[i].count();
		}
		printf("%d\n", res);
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:33:18: error: expected '}' at end of input
   33 |         return 0;
      |                  ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <vector>
#include <cstdio>
#include <algorithm>

#define EPS (1e-5)

using namespace std;


class Point{
public:
  double x, y;
  Point ( double x =0, double y=0): x(x), y(y){}
  Point operator + ( Point p ){ return Point(x + p.x, y + p.y); }
  Point operator - ( Point p ){ return Point(x - p.x, y - p.y); }
  Point operator * ( double a ){ return Point(a*x, a*y); }
  double abs() { return sqrt(norm());}
  double norm() { return x*x + y*y; }
  bool operator < ( const Point &p ) const{
    return x != p.x ? x < p.x : y < p.y;
  }
  bool operator == ( const Point &p ) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};
Point p[100];
int n;

vector<Point> cross(Point a, Point b){
  vector<Point> res;
  if(fabs((b-a).abs()-2.0)<EPS){
    Point c = a + b;
    res.push_back( Point(c.x/2.0, c.y/2.0) );
  }else if((b-a).abs()<2.0){
    Point ab = b - a;
    Point center = a + Point(ab.x/2.0,ab.y/2.0);
    Point un1 = Point(-ab.y/ab.abs(), ab.x/ab.abs());
    Point un2 = Point(ab.y/ab.abs(), -ab.x/ab.abs());
    double dist = sqrt(1.0 - pow(ab.abs() /2.0, 2.0));
    Point c1 = center + un1 * dist;
    Point c2 = center + un2 * dist;
    res.push_back(c1);
    res.push_back(c2);
  }
  return res;
}

int solve(){
  int ans=1;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      vector<Point> c=cross(p[i], p[j]);
      if(c.empty()) continue;
      int cnt1=2, cnt2=2;
      for(int k=0;k<n;k++){
	if(i==k || j==k) continue;
	if((c[0]-p[k]).abs()-1.0<EPS) cnt1++;
	if(c.size()==2 && (c[1]-p[k]).abs()-1.0<EPS) cnt2++;
      }
      ans=max(ans, max(cnt1, cnt2));
    }
  }
  return ans;
}
main(){
  while(1){
    cin >> n;
    if(n==0) break;
    for(int i=0;i<n;i++){
      cin >> p[i].x;
      getchar();
      cin >> p[i].y;
    }
    cout << solve() << endl;
  }
  return 0;
}

Compiler output:
a.cc: In member function 'double Point::abs()':
a.cc:19:25: error: 'sqrt' was not declared in this scope
   19 |   double abs() { return sqrt(norm());}
      |                         ^~~~
a.cc: In member function 'bool Point::operator==(const Point&) const':
a.cc:25:12: error: 'fabs' was not declared in this scope; did you mean 'abs'?
   25 |     return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
      |            ^~~~
      |            abs
a.cc: In function 'std::vector<Point> cross(Point, Point)':
a.cc:33:6: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   33 |   if(fabs((b-a).abs()-2.0)<EPS){
      |      ^~~~
      |      labs
a.cc:41:30: error: 'pow' was not declared in this scope
   41 |     double dist = sqrt(1.0 - pow(ab.abs() /2.0, 2.0));
      |                              ^~~
a.cc:41:19: error: 'sqrt' was not declared in this scope
   41 |     double dist = sqrt(1.0 - pow(ab.abs() /2.0, 2.0));
      |                   ^~~~
a.cc: At global scope:
a.cc:67:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   67 | main(){
      | ^~~~
Language: C++

#include <stdio.h>
#include <list>
#include <string.h>

using namespace std;

#define SQ(x) ((x) * (x))

int n;
char G[100][100];

int check(int n)
{
	int count;
	int result;
	bool loopflag;
	bool chflag;
	
	result = 0;
	do {
		loopflag = false;
		result++;
		do {
			chflag = false;
			for (int i = 0; i < n; i++){
				count = 0;
				for (int j = 0; j < n; j++){
					count += G[i][j];
				}
				if (count > 0){
					loopflag = true;
				}
				if (count <= result){
					for (int j = 0; j < n; j++){
						if (G[i][j] == 1){
							chflag = true;
						}
						G[i][j] = G[j][i] = 0;
					}
				}
			}/*
			for (int i = 0; i < n; i++){
				for (int j = 0; j < n; j++){
					printf("%d ", G[i][j]);
				}
				puts("");
			}
			puts("");*/
		} while (chflag == true);
	} while (loopflag == true);
	
	return (result);
}

int main(void)
{
	double x[100], y[100];
	
	while (1){
		scanf("%d", &n);
		if (n == 0){
			break;
		}
		
		memset(G, 0 , sizeof(G));
		
		for (int i = 0; i < n; i++){
			scanf("%lf,%lf", &x[i], &y[i]);
		}
		
		for (int i = 0; i < n; i++){
			for (int j = i + 1; j < n; j++){
				if (SQ(x[i] - x[j]) + SQ(y[i] - y[j]) <= 4.0){
					G[i][j] = G[j][i] = 1;
				}
			}
		}
		/
		for (int i = 0; i < n; i++){
			for (int j = 0; j < n; j++){
				printf("%d ", G[i][j]);
			}
			puts("");
		}
		
		puts("");*/
		printf("%d\n", check(n));
	}
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:17: error: expected primary-expression before '/' token
   78 |                 /
      |                 ^
a.cc:79:17: error: expected primary-expression before 'for'
   79 |                 for (int i = 0; i < n; i++){
      |                 ^~~
a.cc:79:33: error: 'i' was not declared in this scope
   79 |                 for (int i = 0; i < n; i++){
      |                                 ^
a.cc:86:27: error: expected primary-expression before '/' token
   86 |                 puts("");*/
      |                           ^
Language: C++

#include <stdio.h>
#include <list>
#include <string.h>
#include <sort>

using namespace std;

#define SQ(x) ((x) * (x))

typedef struct {
	int index;
	int degree;
} SORTDATA;

int n;
char G[100][100];
int degree[100];
int ans;

int check(char use[] , int depth)
{
	char next[100];
	int next_count;
	
	if (depth > ans){
		ans = depth;
	}
	
	memset(next, 1, sizeof(next));
	
	next_count = n;
	for (int i = 0; i < n; i++){
		for (int j = 0; j < depth; j++){
			if (G[use[j]][i] == 0 && next[i] == 1){
				next[i] = 0;
				next_count--;
			}
		}
	}
	
	if (next_count == 0){
		return (0);
	}
	
	for (int i = 0; i < n; i++){
		if (next[i] == 1 && degree[i] > ans - 1){
			use[depth] = i;
			check(use, depth + 1);
		}
	}
	
	return (0);
}

int main(void)
{
	double x[100], y[100];
	
	while (1){
		scanf("%d", &n);
		if (n == 0){
			break;
		}
		
		memset(G, 0 , sizeof(G));
		
		for (int i = 0; i < n; i++){
			scanf("%lf,%lf", &x[i], &y[i]);
		}
		
		for (int i = 0; i < n; i++){
			for (int j = i + 1; j < n; j++){
				if (SQ(x[i] - x[j]) + SQ(y[i] - y[j]) <= 4.0){
					G[i][j] = G[j][i] = 1;
				}
			}
		}
		
		SORT_DATA sort_data[100];
		for (int i = 0; i < n; i++){
			degree[i] = 0;
			for (int j = 0; j < n; j++){
				degree[i] += G[i][j];
			}
		}
		
		char use[100];
		memset(use, 0, sizeof(use));
		ans = 1;
		for (int i = 0; i < n; i++){
			use[0] = i;
			check(use, 1);
		}
		printf("%d\n", ans);
	}
	
	return (0);
}

Compiler output:
a.cc:4:10: fatal error: sort: No such file or directory
    4 | #include <sort>
      |          ^~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
#include <list>
#include <string.h>
#include <sort>

using namespace std;

#define SQ(x) ((x) * (x))

typedef struct {
	int index;
	int degree;
} SORTDATA;

int n;
char G[100][100];
int degree[100];
int ans;

int check(char use[] , int depth)
{
	char next[100];
	int next_count;
	
	if (depth > ans){
		ans = depth;
	}
	
	memset(next, 1, sizeof(next));
	
	next_count = n;
	for (int i = 0; i < n; i++){
		for (int j = 0; j < depth; j++){
			if (G[use[j]][i] == 0 && next[i] == 1){
				next[i] = 0;
				next_count--;
			}
		}
	}
	
	if (next_count == 0){
		return (0);
	}
	
	for (int i = 0; i < n; i++){
		if (next[i] == 1 && degree[i] > ans - 1){
			use[depth] = i;
			check(use, depth + 1);
		}
	}
	
	return (0);
}

int main(void)
{
	double x[100], y[100];
	
	while (1){
		scanf("%d", &n);
		if (n == 0){
			break;
		}
		
		memset(G, 0 , sizeof(G));
		
		for (int i = 0; i < n; i++){
			scanf("%lf,%lf", &x[i], &y[i]);
		}
		
		for (int i = 0; i < n; i++){
			for (int j = i + 1; j < n; j++){
				if (SQ(x[i] - x[j]) + SQ(y[i] - y[j]) <= 4.0){
					G[i][j] = G[j][i] = 1;
				}
			}
		}
		
		SORTDATA sort_data[100];
		for (int i = 0; i < n; i++){
			degree[i] = 0;
			for (int j = 0; j < n; j++){
				degree[i] += G[i][j];
			}
		}
		
		char use[100];
		memset(use, 0, sizeof(use));
		ans = 1;
		for (int i = 0; i < n; i++){
			use[0] = i;
			check(use, 1);
		}
		printf("%d\n", ans);
	}
	
	return (0);
}

Compiler output:
a.cc:4:10: fatal error: sort: No such file or directory
    4 | #include <sort>
      |          ^~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <stack>
#include <algorithm>
#include <cstdio>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;


double dist(double x1,double y1,double x2,double y2){
	return ((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}



int main(void){

double tx[101],ty[101];
int n;
char k;
	
	while(cin >> n){
		if(n ==0 || cin.eof()) break;
		rep(i,n) cin >> tx[i] >> k >> ty[i];
		bool ds[101][101];
		int cnt[101]={0};
		rep(i,n) rep2(j,i+1,n)
			if( dist(tx[i],ty[i],tx[j],ty[j]) <= 4.0){
				ds[i][j]=true;
				cnt[i]++; cnt[j]++;
			}
			else        ds[i][j]=false;
		
		
		int mx=0;
		rep(i,n) mx = max(mx, cnt[i]);
		int cmx=0;
		if(mx>0){
			cmx=1;
			rep(k,n){
				vector<int>z;
				int ct2=0;
				if(cnt[k]<=cmx) continue;
				rep(i,n) if(ds[k][i] && i != k) z.push_back(i);
				rep(i,n) if(ds[i][k] && i != k) z.push_back(i);
				sort(z.begin(), z.end());
				z.erase(unique(z.begin(), z.end()),z.end());
				int ct1=z.size();
//				rep(i,ct1) printf("z%d:%d, ",i,z[i]);
				rep(i,ct1) rep2(j,i+1,ct1) if(ds[z[i]][z[j]]) ct2++;
				if( cnt[k]+ct2 >= cnt[k]*(cnt[k]+1)/2) cmx=cnt[k];
				else if( cnt[k]+ct2 >= cnt[k]*(cnt[k]-1)/2 && cnt[k] - 1 > cmx) cmk = cnt[k] -1; 
			}
		}
		
		cout << cmx+1 <<endl;
//		rep(i,n) rep2(j,i+1,n) if(ds[i][j])printf("%d:%d , ",i+1,j+1); printf("\n");
//		rep(i,n) printf("%d:%d, ",i+1,cnt[i]);
	}
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:97: error: 'cmk' was not declared in this scope; did you mean 'cmx'?
   58 |                                 else if( cnt[k]+ct2 >= cnt[k]*(cnt[k]-1)/2 && cnt[k] - 1 > cmx) cmk = cnt[k] -1;
      |                                                                                                 ^~~
      |                                                                                                 cmx
Language: C++

while 1:
  n=input()
  if n==0:break
  X=[]
  for i in range(n):
    x,y=input()
    X.append(complex(x,y))
  m=0
  for i in range(n):
    p0=X[i]
    for j in range(n):
      if i==j:continue
      a,b=cmath.polar(p0-X[j])
      if a<=2:
          dx=a/2.0
          dy=(1-dx**2)**.5
          p1=complex(dx,dy)*cmath.exp(1j*b)+p0
          p2=complex(dx,-dy)*cmath.exp(1j*b)+p0
          s1,s2=0,0
          for k in range(n):
            if k==i or k==j:continue
            if abs(p1-X[k])<=1.06:s1+=1
            if abs(p2-X[k])<=1.06:s2+=1
          if s1>m:m=s1
          if s2>m:m=s2
  print m+2

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while 1:
      | ^~~~~
Language: C++

import math,cmath
while 1:
  n=input()
  if n==0:break
  X=[]
  for i in range(n):
    x,y=input()
    X.append(complex(x,y))
  m=0
  for i in range(n):
    p0=X[i]
    for j in range(n):
      if i==j:continue
      a,b=cmath.polar(p0-X[j])
      if a<=2:
          dx=a/2.0
          dy=(1-dx**2)**.5
          p1=complex(dx,dy)*cmath.exp(1j*b)+p0
          p2=complex(dx,-dy)*cmath.exp(1j*b)+p0
          s1,s2=0,0
          for k in range(n):
            if k==i or k==j:continue
            if abs(p1-X[k])<=1.06:s1+=1
            if abs(p2-X[k])<=1.06:s2+=1
          if s1>m:m=s1
          if s2>m:m=s2
  print m+2

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math,cmath
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
#include <list>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str(); }
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 10;

#include <complex>
typedef complex<double> P;

#define LT(x,y) ((x)-(y)<=-EPS)
#define LE(x,y) ((x)-(y)<+EPS)

vector<P> cross_circles(P c1, double r1, P c2, double r2) {
	double d = abs(c2 - c1);
	if (LT(r1 + r2, d) || LT(d, fabs(r1 - r2))) {
		return vector<P>();
	}
	double l = 0.5*((r1*r1 - r2*r2) / d + d);
	double h = sqrt(r1*r1 - l*l);
	vector<P> ret(2);
	ret[0] = P(l, +h)*(c2 - c1) / d + c1;
	ret[1] = P(l, -h)*(c2 - c1) / d + c1;
	return ret;
}
 
int main() {
	int n;
	while (cin >> n, n) {
		double x, y;
		char c;
		vector<P> circles(n);
		REP(i, n) {
			cin >> x >> c >> y;
			circles[i] = P(x, y);
		}

		int ans = 1;
		REP(i, n - 1) {
			REP(j, i + 1, n - 1) {
				vector<P> pts = cross_circles(circles[i], 1.0, circles[j], 1.0);
				int size = pts.size();
				REP(k, size) {
					int count = 2;
					REP(l, n) {
						if (l == i || l == j) {
							continue;
						}
						else {
							if (LE(abs(circles[l] - pts[k]), 1.0)) {
								count++;
							}
						}
					}
					ans = max(ans, count);
				}
			}
		}

		cout << ans << endl;
	}

	return 0;
}

Compiler output:
a.cc:69:44: error: macro "REP" passed 3 arguments, but takes just 2
   69 |                         REP(j, i + 1, n - 1) {
      |                                            ^
a.cc:32:9: note: macro "REP" defined here
   32 | #define REP(i,n) FOR(i,0,(n)-1)
      |         ^~~
a.cc: In function 'int main()':
a.cc:69:25: error: 'REP' was not declared in this scope
   69 |                         REP(j, i + 1, n - 1) {
      |                         ^~~
Language: Java

import java.io.*;

class Main{
int[] sx={0,0,1,0,-1};
int[] sy={0,1,0,-1,0};
int[] mx={0,0,1,0,-1,-1,-1,1,1};
int[] my={0,1,0,-1,0,-1,1,-1,1};
int[] sx={0,0,1,0,-1,-1,-1,1,1,0,2,0,-2};
int[] my={0,1,0,-1,0,-1,1,-1,1,2,0,-2,0};
int total;
int res;
int[][] map=new int[10][10];
int[][] drop=new int[10][10];
static void sd(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]--;
}
total-=5;
res--;
}
static void sr(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]++;
}
total+=5;
res++;
}
static boolean scd(int x,int y){
for(int i=0;i<sx.length;i++){
int nx=x+sx[i];
int ny=y+sy[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void md(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]--;
}
total-=9;
res--;
}
static void mr(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]++;
}
total+=9;
res++;
}
static boolean mcd(int x,int y){
for(int i=0;i<mx.length;i++){
int nx=x+mx[i];
int ny=y+my[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void ld(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]--;
}
total-=13;
res--;
}
static void lr(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]++;
}
total+=13;
res++;
}
static boolean lcd(int x,int y){
for(int i=0;i<lx.length;i++){
int nx=x+lx[i];
int ny=y+ly[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
public staic void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
res=Integer.parseInt(br.readLine());
total=0;
for(int i=0;i<10;i++){
String[] value=br.readLine().split(" ");
for(int j=0;j<10;j++){
int num=Integer.parseInt(value[j]);
map[i][j]=num;
total+=num;
}
}
if(search(1,1,3)){
for(int i=1;i<9;i++){
for(int j=1;j<9;j++){
if(drop[i][j]!=0){
System.out.println(i+" "+j+" "+drop[i][j]);
}
}
}
}
}
static boolean searchnext(int x,int y){
if(y==8){
return search(x+1,1,3);
}
return search(x,y+1,3);
}
static boolean search(int x,int y,int size){
if(res==0&&total==0){
return true;
}
else if(total<5){
return false;
}
if(x==9){
return false;
}
if(x>2&&y==1){
for(int i=0;i<10;i++){
if(map[x-3][i]!=0){
return false;
}
}
}
switch(size){
case 3:if(lcd(x,y)){
       ld(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       break;
       }
       else{
       lr(x,y);
       }
       }
       size--;
       continue;
case 2:if(mcd(x,y)){
       md(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       break;
       }
       else{
       mr(x,y);
       }
       }
       size--;
       continue;
case 1:if(scd(x,y)){
       sd(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       break;
       }
       else{
       sr(x,y);
       }
       }
       size--;
       continue;
case 0:drop[x][y]=size;
       return searchnext(x,y);
       break;
}
}
}

Compiler output:
Main.java:86: error: <identifier> expected
public staic void main(String[] args) throws IOException{
            ^
1 error
Language: Java

import java.io.*;

class Main{
static int[] sx={0,0,1,0,-1};
static int[] sy={0,1,0,-1,0};
static int[] mx={0,0,1,0,-1,-1,-1,1,1};
static int[] my={0,1,0,-1,0,-1,1,-1,1};
static int[] lx={0,0,1,0,-1,-1,-1,1,1,0,2,0,-2};
static int[] ly={0,1,0,-1,0,-1,1,-1,1,2,0,-2,0};
static int total;
static int res;
static int[][] map=new int[10][10];
static int[][] drop=new int[10][10];
static void sd(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]--;
}
total-=5;
res--;
}
static void sr(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]++;
}
total+=5;
res++;
}
static boolean scd(int x,int y){
for(int i=0;i<sx.length;i++){
int nx=x+sx[i];
int ny=y+sy[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void md(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]--;
}
total-=9;
res--;
}
static void mr(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]++;
}
total+=9;
res++;
}
static boolean mcd(int x,int y){
for(int i=0;i<mx.length;i++){
int nx=x+mx[i];
int ny=y+my[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void ld(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]--;
}
total-=13;
res--;
}
static void lr(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]++;
}
total+=13;
res++;
}
static boolean lcd(int x,int y){
for(int i=0;i<lx.length;i++){
int nx=x+lx[i];
int ny=y+ly[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
res=Integer.parseInt(br.readLine());
total=0;
for(int i=0;i<10;i++){
String[] value=br.readLine().split(" ");
for(int j=0;j<10;j++){
int num=Integer.parseInt(value[j]);
map[i][j]=num;
total+=num;
}
}
if(search(1,1,3)){
for(int i=1;i<9;i++){
for(int j=1;j<9;j++){
if(drop[i][j]!=0){
System.out.println(i+" "+j+" "+drop[i][j]);
}
}
}
}
}
static boolean searchnext(int x,int y){
if(y==8){
return search(x+1,1,3);
}
return search(x,y+1,3);
}
static boolean search(int x,int y,int size){
if(res==0&&total==0){
return true;
}
else if(total<5){
return false;
}
if(x==9){
return false;
}
if(x>2&&y==1){
for(int i=0;i<10;i++){
if(map[x-3][i]!=0){
return false;
}
}
}
switch(size){
case 3:if(lcd(x,y)){
       ld(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       lr(x,y);
       }
       }
       size--;
case 2:if(mcd(x,y)){
       md(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       mr(x,y);
       }
       }
       size--;
case 1:if(scd(x,y)){
       sd(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       sr(x,y);
       }
       }
       size--;
case 0:drop[x][y]=size;
       return searchnext(x,y);
}
}
}

Compiler output:
Main.java:168: error: missing return statement
}
^
1 error
Language: Java

import java.io.*;

class Main{
static int[] sx={0,0,1,0,-1};
static int[] sy={0,1,0,-1,0};
static int[] mx={0,0,1,0,-1,-1,-1,1,1};
static int[] my={0,1,0,-1,0,-1,1,-1,1};
static int[] lx={0,0,1,0,-1,-1,-1,1,1,0,2,0,-2};
static int[] ly={0,1,0,-1,0,-1,1,-1,1,2,0,-2,0};
static int total;
static int res;
static int[][] map=new int[10][10];
static int[][] drop=new int[10][10];
static void sd(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]--;
}
total-=5;
res--;
}
static void sr(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]++;
}
total+=5;
res++;
}
static boolean scd(int x,int y){
for(int i=0;i<sx.length;i++){
int nx=x+sx[i];
int ny=y+sy[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void md(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]--;
}
total-=9;
res--;
}
static void mr(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]++;
}
total+=9;
res++;
}
static boolean mcd(int x,int y){
for(int i=0;i<mx.length;i++){
int nx=x+mx[i];
int ny=y+my[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void ld(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]--;
}
total-=13;
res--;
}
static void lr(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]++;
}
total+=13;
res++;
}
static boolean lcd(int x,int y){
for(int i=0;i<lx.length;i++){
int nx=x+lx[i];
int ny=y+ly[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
res=Integer.parseInt(br.readLine());
total=0;
for(int i=0;i<10;i++){
String[] value=br.readLine().split(" ");
for(int j=0;j<10;j++){
int num=Integer.parseInt(value[j]);
map[i][j]=num;
total+=num;
}
}
if(search(1,1,3)){
for(int i=1;i<9;i++){
for(int j=1;j<9;j++){
if(drop[i][j]!=0){
System.out.println(i+" "+j+" "+drop[i][j]);
}
}
}
}
}
static boolean searchnext(int x,int y){
if(y==8){
return search(x+1,1,3);
}
return search(x,y+1,3);
}
static boolean search(int x,int y,int size){
if(res==0&&total==0){
return true;
}
else if(total<5){
return false;
}
if(x==9){
return false;
}
if(x>2&&y==1){
for(int i=0;i<10;i++){
if(map[x-3][i]!=0){
return false;
}
}
}
switch(size){
case 3:if(lcd(x,y)){
       ld(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       lr(x,y);
       }
       }
       size--;
case 2:if(mcd(x,y)){
       md(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       mr(x,y);
       }
       }
       size--;
case 1:if(scd(x,y)){
       sd(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       sr(x,y);
       }
       }
       size--;
case 0:drop[x][y]=size;
       return searchnext(x,y);
       break;
}
}
}

Compiler output:
Main.java:167: error: unreachable statement
       break;
       ^
Main.java:169: error: missing return statement
}
^
2 errors
Language: Java

import java.io.*;

class Main{
static int[] sx={0,0,1,0,-1};
static int[] sy={0,1,0,-1,0};
static int[] mx={0,0,1,0,-1,-1,-1,1,1};
static int[] my={0,1,0,-1,0,-1,1,-1,1};
static int[] lx={0,0,1,0,-1,-1,-1,1,1,0,2,0,-2};
static int[] ly={0,1,0,-1,0,-1,1,-1,1,2,0,-2,0};
static int total;
static int res;
static int[][] map=new int[10][10];
static int[][] drop=new int[10][10];
static void sd(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]--;
}
total-=5;
res--;
}
static void sr(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]++;
}
total+=5;
res++;
}
static boolean scd(int x,int y){
for(int i=0;i<sx.length;i++){
int nx=x+sx[i];
int ny=y+sy[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void md(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]--;
}
total-=9;
res--;
}
static void mr(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]++;
}
total+=9;
res++;
}
static boolean mcd(int x,int y){
for(int i=0;i<mx.length;i++){
int nx=x+mx[i];
int ny=y+my[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
static void ld(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]--;
}
total-=13;
res--;
}
static void lr(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]++;
}
total+=13;
res++;
}
static boolean lcd(int x,int y){
for(int i=0;i<lx.length;i++){
int nx=x+lx[i];
int ny=y+ly[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
res=Integer.parseInt(br.readLine());
total=0;
for(int i=0;i<10;i++){
String[] value=br.readLine().split(" ");
for(int j=0;j<10;j++){
int num=Integer.parseInt(value[j]);
map[i][j]=num;
total+=num;
}
}
if(search(1,1,3)){
for(int i=1;i<9;i++){
for(int j=1;j<9;j++){
if(drop[i][j]!=0){
System.out.println(i+" "+j+" "+drop[i][j]);
}
}
}
}
}
static boolean searchnext(int x,int y){
if(y==8){
return search(x+1,1,3);
}
return search(x,y+1,3);
}
static boolean search(int x,int y,int size){
if(res==0&&total==0){
return true;
}
else if(total<5){
return false;
}
if(x==9){
return false;
}
if(x>2&&y==1){
for(int i=0;i<10;i++){
if(map[x-3][i]!=0){
return false;
}
}
}
switch(size){
case 3:if(lcd(x,y)){
       ld(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       lr(x,y);
       }
       }
       size--;
case 2:if(mcd(x,y)){
       md(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       mr(x,y);
       }
       }
       size--;
case 1:if(scd(x,y)){
       sd(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       sr(x,y);
       }
       }
       size--;
case 0:drop[x][y]=size;
       return searchnext(x,y);
}
return;
}
}

Compiler output:
Main.java:168: error: incompatible types: missing return value
return;
^
1 error
Language: Java

import java.io.*;

class Main{
static int[] sx={0,0,1,0,-1};
static int[] sy={0,1,0,-1,0};
static int[] mx={0,0,1,0,-1,-1,-1,1,1};
static int[] my={0,1,0,-1,0,-1,1,-1,1};
static int[] lx={0,0,1,0,-1,-1,-1,1,1,0,2,0,-2};
static int[] ly={0,1,0,-1,0,-1,1,-1,1,2,0,-2,0};
static int total;
static int res;
static int[][] map=new int[10][10];
static int[][] drop=new int[10][10];
static void sd(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]--;
}
total-=5;
res--;
}
static void sr(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]++;
}
total+=5;
res++;
}
static boolean scd(int x,int y){
for(int i=0;i<sx.length;i++){
int nx=x+sx[i];
int ny=y+sy[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void md(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]--;
}
total-=9;
res--;
}
static void mr(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]++;
}
total+=9;
res++;
}
static boolean mcd(int x,int y){
for(int i=0;i<mx.length;i++){
int nx=x+mx[i];
int ny=y+my[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
static void ld(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]--;
}
total-=13;
res--;
}
static void lr(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]++;
}
total+=13;
res++;
}
static boolean lcd(int x,int y){
for(int i=0;i<lx.length;i++){
int nx=x+lx[i];
int ny=y+ly[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
res=Integer.parseInt(br.readLine());
total=0;
for(int i=0;i<10;i++){
String[] value=br.readLine().split(" ");
for(int j=0;j<10;j++){
int num=Integer.parseInt(value[j]);
map[i][j]=num;
total+=num;
}
}
if(search(1,1,3)){
for(int i=1;i<9;i++){
for(int j=1;j<9;j++){
if(drop[i][j]!=0){
System.out.println(i+" "+j+" "+drop[i][j]);
}
}
}
}
}
static boolean searchnext(int x,int y){
if(y==8){
return search(x+1,1,3);
}
return search(x,y+1,3);
}
static boolean search(int x,int y,int size){
if(res==0&&total==0){
return true;
}
else if(total<5){
return false;
}
if(x==9){
return false;
}
if(x>2&&y==1){
for(int i=0;i<10;i++){
if(map[x-3][i]!=0){
return false;
}
}
}
switch(size){
case 3:if(lcd(x,y)){
       ld(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       lr(x,y);
       }
       }
       size--;
case 2:if(mcd(x,y)){
       md(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       mr(x,y);
       }
       }
       size--;
case 1:if(scd(x,y)){
       sd(x,y);
       if(searchnext(x,y)){
       drop[x][y]=size;
       return true;
       }
       else{
       sr(x,y);
       }
       }
       size--;
case 0:drop[x][y]=size;
       return searchnext(x,y);
}
}
}

Compiler output:
Main.java:168: error: missing return statement
}
^
1 error
Language: Java

import java.io.*;

class Main{
static int[] sx={0,0,1,0,-1};
static int[] sy={0,1,0,-1,0};
static int[] mx={0,0,1,0,-1,-1,-1,1,1};
static int[] my={0,1,0,-1,0,-1,1,-1,1};
static int[] lx={0,0,1,0,-1,-1,-1,1,1,0,2,0,-2};
static int[] ly={0,1,0,-1,0,-1,1,-1,1,2,0,-2,0};
static int total;
static int res;
static int[][] map=new int[10][10];
static int[][] drop=new int[10][10];
static void sd(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]--;
}
total-=5;
res--;
}
static void sr(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]++;
}
total+=5;
res++;
}
static boolean scd(int x,int y){
for(int i=0;i<sx.length;i++){
int nx=x+sx[i];
int ny=y+sy[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void md(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]--;
}
total-=9;
res--;
}
static void mr(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]++;
}
total+=9;
res++;
}
static boolean mcd(int x,int y){
for(int i=0;i<mx.length;i++){
int nx=x+mx[i];
int ny=y+my[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
static void ld(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]--;
}
total-=13;
res--;
}
static void lr(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]++;
}
total+=13;
res++;
}
static boolean lcd(int x,int y){
for(int i=0;i<lx.length;i++){
int nx=x+lx[i];
int ny=y+ly[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
res=Integer.parseInt(br.readLine());
total=0;
for(int i=0;i<10;i++){
String[] value=br.readLine().split(" ");
for(int j=0;j<10;j++){
int num=Integer.parseInt(value[j]);
map[i][j]=num;
total+=num;
}
}
if(search(1,1,3)){
for(int i=1;i<9;i++){
for(int j=1;j<9;j++){
if(drop[i][j]!=0){
System.out.println(i+" "+j+" "+drop[i][j]);
}
}
}
}
}
static boolean searchnext(int x,int y){
if(y==8){
return search(x+1,1,3);
}
return search(x,y+1,3);
}
static boolean search(int x,int y,int size){
if(res==0&&total==0){
return true;
}
else if(total<5){
return false;
}
if(x==9){
return false;
}
if(x>2&&y==1){
for(int i=0;i<10;i++){
if(map[x-3][i]!=0){
return false;
}
}
}
switch(size){
case 3:if(lcd(x,y)){
       ld(x,y);
       drop[x][y]=3;
       if(searchnext(x,y)){
       return true;
       }
       else{
       lr(x,y);
       }
       }
       size--;
case 2:if(mcd(x,y)){
       md(x,y);
       drop[x][y]=2;
       if(searchnext(x,y)){
       return true;
       }
       else{
       mr(x,y);
       }
       }
       size--;
case 1:if(scd(x,y)){
       sd(x,y);
       drop[x][y]=1;
       if(searchnext(x,y)){
       return true;
       }
       else{
       sr(x,y);
       }
       }
       size--;
case 0:drop[x][y]=0;
       return searchnext(x,y);
}
}
}

Compiler output:
Main.java:168: error: missing return statement
}
^
1 error
Language: Java

import java.io.*;

class Main{
static int[] sx={0,0,1,0,-1};
static int[] sy={0,1,0,-1,0};
static int[] mx={0,0,1,0,-1,-1,-1,1,1};
static int[] my={0,1,0,-1,0,-1,1,-1,1};
static int[] lx={0,0,1,0,-1,-1,-1,1,1,0,2,0,-2};
static int[] ly={0,1,0,-1,0,-1,1,-1,1,2,0,-2,0};
static int total;
static int res;
static int[][] map=new int[10][10];
static int[][] drop=new int[10][10];
static void sd(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]--;
}
total-=5;
res--;
}
static void sr(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]++;
}
total+=5;
res++;
}
static boolean scd(int x,int y){
for(int i=0;i<sx.length;i++){
int nx=x+sx[i];
int ny=y+sy[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void md(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]--;
}
total-=9;
res--;
}
static void mr(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]++;
}
total+=9;
res++;
}
static boolean mcd(int x,int y){
for(int i=0;i<mx.length;i++){
int nx=x+mx[i];
int ny=y+my[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
static void ld(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]--;
}
total-=13;
res--;
}
static void lr(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]++;
}
total+=13;
res++;
}
static boolean lcd(int x,int y){
for(int i=0;i<lx.length;i++){
int nx=x+lx[i];
int ny=y+ly[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
res=Integer.parseInt(br.readLine());
total=0;
for(int i=0;i<10;i++){
String[] value=br.readLine().split(" ");
for(int j=0;j<10;j++){
int num=Integer.parseInt(value[j]);
map[i][j]=num;
total+=num;
}
}
if(search(1,1,3)){
for(int i=1;i<9;i++){
for(int j=1;j<9;j++){
if(drop[i][j]!=0){
System.out.println(i+" "+j+" "+drop[i][j]);
}
}
}
}
}
static boolean searchnext(int x,int y){
if(y==8){
return search(x+1,1,3);
}
return search(x,y+1,3);
}
static boolean search(int x,int y,int size){
if(res==0&&total==0){
return true;
}
else if(total<5){
return false;
}
if(x==9){
return false;
}
if(x>2&&y==1){
for(int i=0;i<10;i++){
if(map[x-3][i]!=0){
return false;
}
}
}
switch(size){
case 3:if(lcd(x,y)){
       ld(x,y);
       drop[x][y]=3;
       if(searchnext(x,y)){
       return true;
       }
       else{
       lr(x,y);
       }
       }
       size--;
case 2:if(mcd(x,y)){
       md(x,y);
       drop[x][y]=2;
       if(searchnext(x,y)){
       return true;
       }
       else{
       mr(x,y);
       }
       }
       size--;
case 1:if(scd(x,y)){
       sd(x,y);
       drop[x][y]=1;
       if(searchnext(x,y)){
       return true;
       }
       else{
       sr(x,y);
       }
       }
       size--;
case 0:drop[x][y]=0;
       return searchnext(x,y);
break;
}
}
}

Compiler output:
Main.java:167: error: unreachable statement
break;
^
Main.java:169: error: missing return statement
}
^
2 errors
Language: Java

import java.io.*;
 
class Main{
static int[] sx={0,0,1,0,-1};
static int[] sy={0,1,0,-1,0};
static int[] mx={0,0,1,0,-1,-1,-1,1,1};
static int[] my={0,1,0,-1,0,-1,1,-1,1};
static int[] lx={0,0,1,0,-1,-1,-1,1,1,0,2,0,-2};
static int[] ly={0,1,0,-1,0,-1,1,-1,1,2,0,-2,0};
static int total;
static int res;
static int[][] map=new int[10][10];
static int[][] drop=new int[10][10];
static void sd(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]--;
}
total-=5;
res--;
}
static void sr(int x,int y){
for(int i=0;i<sx.length;i++){
map[x+sx[i]][y+sy[i]]++;
}
total+=5;
res++;
}
static boolean scd(int x,int y){
for(int i=0;i<sx.length;i++){
int nx=x+sx[i];
int ny=y+sy[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]<=0){
return false;
}
}
return true;
}
static void md(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]--;
}
total-=9;
res--;
}
static void mr(int x,int y){
for(int i=0;i<mx.length;i++){
map[x+mx[i]][y+my[i]]++;
}
total+=9;
res++;
}
static boolean mcd(int x,int y){
for(int i=0;i<mx.length;i++){
int nx=x+mx[i];
int ny=y+my[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
static void ld(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]--;
}
total-=13;
res--;
}
static void lr(int x,int y){
for(int i=0;i<lx.length;i++){
map[x+lx[i]][y+ly[i]]++;
}
total+=13;
res++;
}
static boolean lcd(int x,int y){
for(int i=0;i<lx.length;i++){
int nx=x+lx[i];
int ny=y+ly[i];
if(nx<0||ny<0||nx>=10||ny>=10||map[nx][ny]==0){
return false;
}
}
return true;
}
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
res=Integer.parseInt(br.readLine());
total=0;
for(int i=0;i<10;i++){
String[] value=br.readLine().split(" ");
for(int j=0;j<10;j++){
int num=Integer.parseInt(value[j]);
map[i][j]=num;
total+=num;
}
}
if(search(1,1,3)){
for(int i=1;i<9;i++){
for(int j=1;j<9;j++){
if(drop[i][j]!=0){
System.out.println(i+" "+j+" "+drop[i][j]);
}
}
}
}
}
static boolean searchnext(int x,int y){
if(y==8){
return search(x+1,1,3);
}
return search(x,y+1,3);
}
static boolean search(int x,int y,int size){
if(res==0&&total==0){
return true;
}
else if(total<5){
return false;
}
else if(res==0){
return false
}
if(x==9){
return false;
}
if(x>2&&y==1){
for(int i=0;i<10;i++){
if(map[x-3][i]!=0){
return false;
}
}
}
while(true){
switch(size){
case 3:if(lcd(x,y)){
       ld(x,y);
       drop[x][y]=3;
       if(searchnext(x,y)){
       return true;
       }
       else{
       lr(x,y);
       }
       }
       size--;
case 2:if(mcd(x,y)){
       md(x,y);
       drop[x][y]=2;
       if(searchnext(x,y)){
       return true;
       }
       else{
       mr(x,y);
       }
       }
       size--;
case 1:if(scd(x,y)){
       sd(x,y);
       drop[x][y]=1;
       if(searchnext(x,y)){
       return true;
       }
       else{
       sr(x,y);
       }
       }
       size--;
case 0:drop[x][y]=0;
       return searchnext(x,y);
}
}
}
}

Compiler output:
Main.java:122: error: ';' expected
return false
            ^
1 error