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

#include <string.h>
#include <iostream>
#include <queue>
#include <set>
#include <vector>
using namespace std;

const int MAX_N = 101;
const int MAX_M = 101;
const int MAX_F = 1000000;

int table[MAX_N][MAX_N];
int status[MAX_M][MAX_N];
int N, M;

typedef unsigned long long ULL;
typedef vector<int> VI;
typedef set<int> SI;

void solve(int k);
ULL point(SI& s);
bool is_finish(SI& s);

ULL maxval = 0;

struct state {
	int p;
	SI s;
};

vector<state> cls;

int main() {
	int u, v, f;
	cls = vector<state>();

	// read data
	cin >> N >> M;
	memset(&table[0][0], 0, sizeof(int) * MAX_N * MAX_N);
	memset(&table[0][0], 0, sizeof(int) * MAX_M * MAX_N);
	for(int m=0; m<M; m++) {
		cin >> u >> v >> f;
		table[u-1][v-1] = f;
		table[v-1][u-1] = f;
		status[m][u-1] = 1;
		status[m][v-1] = 1;
	}

	// solve problem
	maxval = 0;
	for(int i=0; i<M; i++) {
		solve(i);
	}

	// print answer
	cout << maxval << endl;
}

void solve(int k) {
	queue<SI> que;
	
	// set initial node
	SI s = SI();
	for(int i=0; i<N; i++) {
		if(status[k][i]) s.insert(i);
	}
	if(s.size() == 0) return;

	que.push(s);
	while(!que.empty()) {
		SI cs = que.front();
		que.pop();

		if(is_finish(cs)) continue;

		ULL p = point(cs);
		if(maxval < p) maxval = p;
		
		int s = cs.size();
		if(s == N) continue;
		for(int i=0; i<N; i++) {
			bool is_f = true;
			for(SI::const_iterator jt = cs.begin(); jt != cs.end(); ++jt) {
				int u = (*jt);
				if(i != u && table[i][u] == 0) {
					is_f = false;
					break;
				}
			}
			
			if(is_f) {
				SI ns = SI();
				for(SI::const_iterator it = cs.begin(); it != cs.end(); ++it) ns.insert((*it));
				ns.insert(i);
				que.push(ns);
			}
		}
	}
}

ULL point(SI& s) {
	ULL val = 0;
	for(SI::const_iterator it=s.begin(); it != s.end(); ++it) {
		int min_f = MAX_F;
		for(SI::const_iterator jt=s.begin(); jt != s.end(); ++jt) {
			if(it == jt) continue;
			int k = (*it);
			int l = (*jt);
			if(min_f > table[k][l]) min_f = table[k][l];
		}
		val += (ULL)min_f;
	}

	state st;
	st.p = val;
	st.s = s;
	cls.push_back(st);

	return val;
}

bool is_finish(SI& s) {
	int size = cls.size();
	for(int i=0; i<size; i++) {
		SI s0 = cls[i].s;
		if(s.size() != s0.size()) continue;

		SI::const_iterator it = s.begin();
		SI::const_iterator it0 = s0.begin();
		bool is_match = true;
		while(it != s.end() && it0 != s0.end()) {
			if((*it) != (*it0)) {
				is_match = false;
				break;
			}
			++it;
			++it0;
		}
		if(is_match) return true;
	}
	return false;
}

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

#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <vector>
using namespace std;

template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }

constexpr int MAX_N = 100;

int n, m;
map<int, int> G[MAX_N];

int base;
int ans = -1;

void calc(const vector<int> &nodes) {
	const int V = nodes.size();

	vector<int> idx(n, -1);
	for(int i = 0; i < V; ++i) {
		idx[nodes[i]] = i;
	}

	for(int bit = 0; bit < (1 << V); ++bit) {
		int sum = 0;

		for(int i = 0; i < V; ++i) {
			if(bit & (1 << i)) continue;

			int score = INT_MAX;
			const int v = nodes[i];

			for(int j = 0; j < V; ++j) {
				if(i == j || (bit & (1 << j))) continue;

				const int u = nodes[j];
				if(!G[u].count(v)) goto ng;
				chmin(score, G[u][v]);
			}

			if(score != INT_MAX) sum += score;
		}
	 
		chmax(ans, sum);
	ng:;
	}
}

void dfs(int v = 0) {
	if(v == n) return;

	if(static_cast<int>(G[v].size()) <= base) {
		vector<int> nodes(G[v].size() + 1);

		auto it = G[v].cbegin();
		for(int i = 0; it != G[v].cend(); ++i, ++it) {
			nodes[i] = it->first;
		}
		nodes.back() = v;
		calc(nodes);
	}
	dfs(v + 1);
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	cin >> n >> m;

	base = sqrt(2 * m);

	for(int i = 0; i < m; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		--a; --b;
		G[a].insert({b, c});
		G[b].insert({a, c});
	}

	dfs();

	if(ans == -1) {
		vector<int> nodes(n);
		iota(nodes.begin(), nodes.end(), 0);
		calc(nodes);
	}

	cout << ans << endl;

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'void calc(const std::vector<int>&)':
a.cc:34:37: error: 'INT_MAX' was not declared in this scope
   34 |                         int score = INT_MAX;
      |                                     ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <vector>
  +++ |+#include <climits>
    7 | using namespace std;
Language: C++

#include<iostream>
#include<string.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<math.h>

using namespace std;
typedef unsigned long long ll;

const int mod=1000000007;

int n,m,u,v,f;
int ma[102][102];
int invite[102];

int dfs(int cur, int in){
    if(cur==n){
        if(in<2)return 0;
        int tot=0;
        for(int i=0;i<in;i++){
            int t=INT_MAX;
            for(int j=0;j<in;j++){
                if(i!=j){
                    t=min(t,ma[invite[i]][invite[j]]);
                }
            }
            tot+=t;
        }
        return tot;
    }
    int ret=dfs(cur+1,in);
    bool ok=true;
    for(int i=0;i<in;i++){
        if(ma[cur][invite[i]]==0){
            ok=false;
        }
    }
    if(ok){
        invite[in]=cur;
        ret=max(dfs(cur+1,in+1),ret);
    }
    return ret;
}

int main(){
    cin>>n>>m;
    memset(ma,0,sizeof(ma));
    for(int i=0;i<m;i++){
        cin>>u>>v>>f;
        ma[u-1][v-1]=f;
        ma[v-1][u-1]=f;
    }
    cout<<dfs(0,0)<<endl;
}

Compiler output:
a.cc: In function 'int dfs(int, int)':
a.cc:25:19: error: 'INT_MAX' was not declared in this scope
   25 |             int t=INT_MAX;
      |                   ^~~~~~~
a.cc:10:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include<math.h>
  +++ |+#include <climits>
   10 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);++i)
#define rep(i,n) REP(i, 0, n)

int w[101][101];
int N, M, ans;
vector<int> use;
void dfs(int depth) {
    if(depth == N) {
        if(use.size() < 2) return;
        int sum = 0;
        for(int& k : use) {
            int mi = INF;
            for(int& l : use) if(k != l)
              mi = min(mi, w[k][l]);
            sum += mi;
        }
        ans = max(ans, sum);
        return;
    }
    bool ok = true;
    for(int& k : use) if(!w[k][depth]) ok = false;
    dfs(depth + 1);
    if(ok) {
        use.push_back(depth);
        dfs(depth + 1);
        use.pop_back();
    }
    return;
}
int main() {
    scanf("%d%d", &N, &M);
    int u_, v_, w_;
    memset(w, 0, sizeof(w));
    rep(i, M) {
        scanf("%d%d%d", &u_, &v_, &w_);
        --u_; --v_;
        w[u_][v_] = w[v_][u_] = w_;
    }
    ans = 0; 
    dfs(0);
    printf("%d\n", ans);
  

Compiler output:
a.cc: In function 'int main()':
a.cc:44:25: error: expected '}' at end of input
   44 |     printf("%d\n", ans);
      |                         ^
a.cc:33:12: note: to match this '{'
   33 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <fstream>
#include <vector>

using namespace std;

const int NMax = 150;

int A[NMax][NMax];
int used[NMax];
int N, M;

int bkt (int x, int y)
{
    if (x >= N)
	{
        if (y < 2)
			return 0;
		int ans = 0;
		for (int i = 0; i < y; ++i)
		{
            int Min = INT_MAX;

            for (int j = 0; j < y; ++j)
				if (i != j)
					Min = min(Min, A[used[i]][used[j]]);

			ans = ans + Min;
		}

		return ans;
	}

	int ans = bkt(x + 1, y);
	int Ok = 0;

	for (int i = 0; i < y; ++i)
		if (!A[used[i]][x])
			Ok = 1;

	if (!Ok)
	{
        used[y] = x;
        ans = max(ans, bkt(x+1, y+1));
	}

	return ans;
}

int main()
{
	cin >> N >> M;

	for (int i = 0; i < M; ++i)
	{
        int u, v, f;

        cin >> u >> v >> f;
		A[u-1][v-1] = A[v-1][u-1] = f;

	}

	int ans = bkt(0,0);
	cout <<ans <<'\n';
    return 0;
}



Compiler output:
a.cc: In function 'int bkt(int, int)':
a.cc:22:23: error: 'INT_MAX' was not declared in this scope
   22 |             int Min = INT_MAX;
      |                       ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 |
Language: C++

#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;


int N,M;
int graph[100][100];

bool friendly(vector<int>& u, int k)
{
	for(int i=0; i<u.size(); i++) 
		if(graph[u[i]][k] == 0) return false;

	return true;
}

int solve(vector<int>& u, int k)
{
	int res = 0;
	for(int i=k; i<N; i++) {
		if(!friendly(u, i)) continue;

		int tc = 0;
		u.push_back(i);

		if(u.size() > 1) {
			for(int j=0; j<u.size(); j++) {
				int v = (1<<28);
				for(int k=0; k<u.size(); k++) {
					if(j==k) continue;
					v = min(v, graph[u[j]][u[k]]);
				}
				tc += v;
			}
		}

		res = max(res, tc);
		res = max(res, solve(u,i+1));

		u.pop_back();
	}

	return res;
}

int main()
{
	memset(graph,0,sizeof(graph));

	cin >> N >> M;
	for(int i=0; i<M; i++) {
		int s,t,c;
		cin >> s >> t >> c;
		s--; t--;

		graph[s][t] = graph[t][s] = c;
	}

	cout << solve(vector<int>(), 0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:23: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>'
   61 |         cout << solve(vector<int>(), 0) << endl;
      |                       ^~~~~~~~~~~~~
a.cc:19:24: note:   initializing argument 1 of 'int solve(std::vector<int>&, int)'
   19 | int solve(vector<int>& u, int k)
      |           ~~~~~~~~~~~~~^
Language: C++

#include <iostream>
#include <vector>
#include <map>
using namespace std;

typedef vector<int> VI;
typedef pair<int, int> PII;

int N, M;
int u, v, f;
const int MAX_N = 101;
const int MAX_F = 1000000;

int maxv = 0;
int table[MAX_N][MAX_N];
bool att[MAX_N];

void solve(int last) {
	int ret = 0;
	for(int i=0; i<last+1; i++) {
		if(!att[i]) continue;
		int minF = MAX_F;
		for(int j=0; j<N; j++) {
			if(i == j) continue;
			if(!att[j]) continue;
			minF = min(minF, table[i][j]);
		}
		if(minF == MAX_F) continue;
		ret += minF;
	}
	maxv = max(maxv, ret);

	for(int i=last+1; i<N; i++) {
		bool isF = true;
		for(int j=0; j<last+1; j++) {
			if(!att[j]) continue;
			if(table[i][j]==0) { isF = false; break; }
		}
		if(!isF) continue;
		att[i] = true;
		solve(i);
		att[i] = false;
	}
}

int main() {
	cin >> N >> M;
	memset(table, 0, sizeof(int) * MAX_N * MAX_N);
	for(int i=0; i<N; i++) att[i] = false;	
	for(int i=0; i<M; i++) {
		cin >> u >> v >> f;
		u--;
		v--;
		table[u][v] = f;
		table[v][u] = f;
	}
	maxv = 0;
	solve(-1);
	cout << maxv << endl;

	return 0;
}

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

#include<iostream>

using namespace std;

int rab1[101],rab2[101],fri[101];
int n,m;
int usemin[101];

int getpoint(int usemap[101],int count){
	int ans = 0;
	for(int i=1;i<=n;i++){
		if(usemap[i]==count-1){
			ans += usemin[i];
		}else if(usemap[i]){
			return 0;
		}
	}
	return ans;
}


int solve(int usemap[101],int i,int count){
	if(i==m){
		return 0;
	}
	int ans1=0,ans2=0;
	int buf=0;
	if(!usemap[rab1[i]]){
		buf++;
	}
	if(!usemap[rab2[i]]){
		buf++;
	}
	if(count+buf < 14){
		usemap[rab1[i]]++;
		usemap[rab2[i]]++;
		int minbuf1 = usemin[rab1[i]];
		int minbuf2 = usemin[rab2[i]];
		usemin[rab1[i]] = min(usemin[rab1[i]],fri[i]);
		usemin[rab2[i]] = min(usemin[rab2[i]],fri[i]);
		ans1 = max(solve(usemap,i+1,count+buf),getpoint(usemap,count+buf));
		usemap[rab1[i]]--;
		usemap[rab2[i]]--;
		usemin[rab1[i]] = minbuf1;
		usemin[rab2[i]] = minbuf2;
	}
	ans2 = solve(usemap,i+1,count);

	return max(ans1,ans2);
}

int main(){
	memset(usemin,(1000*1000+1),sizeof(usemin));
	cin >> n >> m;
	for(int i=0;i<m;i++){
		cin >> rab1[i] >> rab2[i] >> fri[i];
	}
	int usemap[101];
	memset(usemap,0,sizeof(usemap));
	int ans = solve(usemap,0,0);
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:9: error: 'memset' was not declared in this scope
   53 |         memset(usemin,(1000*1000+1),sizeof(usemin));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <stdio.h>
#include <malloc.h>

typedef struct Node
{
	int data;
	int num;
	struct Node *next;
}*LNode;

int main()
{
	int n, m;
	int x;
	LNode head, p, q;
	
	scanf ("%d%d", &n, &m);
	p = (Node*)malloc(sizeof(Node));
	scanf ("%d", &p->data);
	p->num = 1;
	head = p;
	
	for (int i = 2; i <= n; i ++)
	{
		q = (Node*)malloc(sizeof(Node));
		scanf ("%d", &q->data);
		q->num = i;
		p->next = q;
		p = p->next;
	}
	p->next = head;
	
	while (p->next != p)
	{
		while (-- m)
		{
			p = p->next;
		}
		q = (Node*)malloc(sizeof(Node));
		q = p->next;
		m = q->num;
		p->next = q->next;
		printf ("%d  ", q->num);
		free(q);
	}
	printf ("%d\n", p->num);
	free(p);
	
	system("pause");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:9: error: 'system' was not declared in this scope
   49 |         system("pause");
      |         ^~~~~~
Language: C++

#include <stdio.h> #include <string.h> #include <algorithm> #include <iostream> #include <math.h> #include <assert.h> #include <vector> using namespac

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <stdio.h> #include <string.h> #include <algorithm> #include <iostream> #include <math.h> #include <assert.h> #include <vector> using namespac
      |                    ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <cmath>
#include <stack>
#include <string>
#include <map>
#include <set>
#define pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define inf 0x3f3f3f3f
#define INF 1e18
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define mem0(a) memset(a, 0, sizeof(a))
#define memi(a) memset(a, inf, sizeof(a))
#define mem1(a) memset(a, -1, sizeof(a))
using namespace std;
typedef pair<int, int> P;
const double eps = 1e-10;
const int maxn = 1e5 + 5;
const int mod = 1e8;

int n;
double v, x, y;
const double g = 9.8;
double l[maxn], r[maxn], t[maxn], b[maxn];
bool ok;

double calc(double vy, double t){
    return vy * t - g * t * t / 2;
}
int cmp(double lb, double ub, double a){
    return a < lb + eps ? -1 : a > ub - eps ? 1 : 0;
}
bool check(int qx, int qy){
    double a = g * g / 4, B = g * qy - v * v, c = qx * qx + qy * qy;
    double D = B * B - 4 * a * c;
    if (D < 0 && D > -eps) D = 0;
    if (D < 0) return false;
    for (int d = -1; d <= 1; d += 2){
        double t2 = (-B + d * sqrt(D)) / (2 * a);
        if (t2 <= 0) continue;
        double T = sqrt(t2);
        double vx = qx / T, vy = (qy + g * T * T / 2) / T;

        double yt = calc(vy, x / vx);
        if (yt < y - eps) continue;
        bool ok = true;
        for (int i = 0; i < n; i++){
            if (l[i] >= x) continue;
            if (r[i] == x && y <= t[i] && b[i] <= yt) ok = false;
            int yl = cmp(b[i], t[i], calc(vy, l[i] / vx));
            int yr = cmp(b[i], t[i], calc(vy, r[i] / vx));
            int xh = cmp(l[i], r[i], vx * (vy / g));
            int yh = cmp(b[i], t[i], calc(vy, vy / g));
            if (xh == 0 && yh >= 0 && yl < 0) ok = false;
            if (yl * yr <= 0) ok = false;
        }
        if (ok) return true;
    }
    return false;
}
int main(void)
{
//	freopen("C:\\Users\\wave\\Desktop\\NULL.exe\\NULL\\in.txt","r", stdin);
    while (~scanf("%d %lf %lf %lf", &n, &v, &x, &y)){
        for (int i = 0; i < n; i++)
            scanf("%lf %lf %lf %lf", &l[i], &b[i], &r[i], &t[i]);
        for (int i = 0; i < n; i++)
            r[i] = min(r[i], x);
        ok = check(x, y);
        for (int i = 0; i < n; i++){
            ok |= check(l[i], t[i]);
            ok |= check(r[i], t[i]);
        }
        puts(ok ? "Yes" : "No");
    }

	return 0;
}

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

#include<stdio.h>
#include<math.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#define maxn 55
#define eps 1e-8
const double g=9.8;
using namespace std;
int n;
double v,x,y;
double l[maxn],b[maxn],r[maxn],t[maxn];
double cal(double t,double vy)
{
    return vy*t-g*t*t/2;
}
int cmp(double lowb,double upb,double a)
{
    if(a<lowb-eps)
        return -1;
    if(a>upb+eps)
        return 1;
    return 0;
}
bool judge(int qx,int qy)//通??个点的??是t
{
    double a=g*g/4,bb=g*qy-v*v,c=qx*qx+qy*qy;
    double d=bb*bb-4*a*c;
    if(d<0&&d>-eps)
        d=0;
    if(d<0)
        return false;
    for(int cnt=-1;cnt<=1;cnt+=2)
    {
        double t_sq=(-bb+cnt*sqrt(d))/(2*a);
        if(t_sq<0)
            continue;
        double tt=sqrt(t_sq);
        double vx=qx/tt,vy=(qy+g*tt*tt/2)/tt;
        double yt=cal(x/vx,vy);//猪的正上方坐?
        if(yt<y-eps)
            continue;
        bool ans=true;
        for(int i=0;i<n;i++)
        {
            if(l[i]>=x)
                continue;
            if(r[i]==x&&b[i]<=yt&&t[i]>=y)
                ans=false;
            int yl=cmp(b[i],t[i],cal(l[i]/vx,vy));
            int yr=cmp(b[i],t[i],cal(r[i]/vx,vy));
            int xh=cmp(l[i],r[i],vx*vy/g);
            int yh=cmp(b[i],t[i],cal(vy/g,vy));
            if(yl*yr<=0)
                ans=false;
            if(xh==0&&yh>=0&&yl<=0)
                ans=false;
        }
        if(ans)
            return true;
    }
    return false;
}
int main()
{
    while(scanf("%d%lf%lf%lf",&n,&v,&x,&y)!=EOF)
    {
        for(int i=0;i<n;i++)
            scanf("%lf%lf%lf%lf",&l[i],&b[i],&r[i],&t[i]);
        for(int i=0;i<n;i++)
            r[i]=min(r[i],x);
        bool flag=judge(x,y);
        for(int i=0;i<n;i++)
        {
            flag=flag|judge(l[i],t[i]);
            flag=flag|judge(r[i],t[i]);
        }
        if(flag)
            printf("Yes\n");
        else
            printf("No\n");
    }
    return 0;
}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)

typedef long double ld;
typedef complex<ld> P;
typedef vector<P> VP;
const ld eps = 1e-8, pi = acos(-1.0);

const double G = -9.8;
int N,V,X,Y;

int check(int px,int py,int l,int r,int b,int t){
  int rs1=1;
  int rs2=1;
  ld vx = V * (ld)px / sqrt(px*px+py*py);
  ld vy = V * (ld)py / sqrt(px*px+py*py);
  ld wY1,wY2;
  if(l<=X){
    ld t1 = (ld)l/vx;
    ld t2 = (ld)r/vx;
    wY1 = vy*t1 + G*t1*t1/2;
    wY2 = vy*t2 + G*t1*t1/2;

    if(wY1>t) rs1 = 1;
    else if ((b<=wY1)&&(wY1<=t)) rs1 = 0;
    else if(wY1 < b) rs1 = -1;
    if(wY2>t) rs2 = 1;
    else if ((b<=wY2)&&(wY2<=t)) rs2 = 0;
    else if(wY2 < b) rs2 = -1;
  }

  ld t3 = X/vx;
  ld wY3 = vy*t3 + G*t3*t3/2;
    //cout << wY1 << "  " << wY2 << "  " << wY3;// <<endl;
  if(wY3<Y) {//cout <<"todokanai"<<endl;return -1;}
  else {//cout << rs1 << " " <<rs2<<endl; return rs1 * rs2;}
}
int main(){
  cin >> N >> V >> X >> Y;
  vector<int> L(N),B(N),R(N),T(N);
  REP(i,N){
    cin >> L[i] >> B[i] >> R[i] >> T[i];
  }
  int flag = 1;
  REP(i,N){
    if((L[i]<=X)&&(X<=R[i])&&(T[i]>Y)) {
      flag = -1;
    }
  }
  if(flag == 1){
    int flag2 = 0;
    REP(i,N){
      REP(j,N){
        if(check(L[i],T[i],L[j],R[j],B[j],T[j])>0) flag2 = 1;
        if(check(L[i],B[i],L[j],R[j],B[j],T[j])>0) flag2 = 1;
        if(check(R[i],T[i],L[j],R[j],B[j],T[j])>0) flag2 = 1;
        if(check(R[i],B[i],L[j],R[j],B[j],T[j])>0) flag2 = 1;
      }
    }
    if(flag2==0) flag = -1;
    //cout << flag2 <<endl;
    if((N==0)||(flag==1)) cout << "Yes" <<endl;
    else cout << "No" <<endl;
  }else{
    cout << "No" <<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int check(int, int, int, int, int, int)':
a.cc:52:3: error: expected '}' before 'else'
   52 |   else {//cout << rs1 << " " <<rs2<<endl; return rs1 * rs2;}
      |   ^~~~
a.cc:51:13: note: to match this '{'
   51 |   if(wY3<Y) {//cout <<"todokanai"<<endl;return -1;}
      |             ^
a.cc:54:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   54 | int main(){
      |         ^~
a.cc:54:9: note: remove parentheses to default-initialize a variable
   54 | int main(){
      |         ^~
      |         --
a.cc:54:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:54:11: error: a function-definition is not allowed here before '{' token
   54 | int main(){
      |           ^
a.cc:84:2: error: expected '}' at end of input
   84 | }
      |  ^
a.cc:28:49: note: to match this '{'
   28 | int check(int px,int py,int l,int r,int b,int t){
      |                                                 ^
a.cc:84:2: warning: no return statement in function returning non-void [-Wreturn-type]
   84 | }
      |  ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)

typedef long double ld;
typedef complex<ld> P;
typedef vector<P> VP;
const ld eps = 1e-8, pi = acos(-1.0);

const double G = -9.8;
int N,V,X,Y;

int check(int px,int py,int l,int r,int b,int t){
  int rs1=1;
  int rs2=1;
  ld vx = V * (ld)px / sqrt(px*px+py*py);
  ld vy = V * (ld)py / sqrt(px*px+py*py);
  ld wY1,wY2;
  if (vx == 0) return -1;
  if((l<=X)&&(vx!=0)){
    ld t1 = (ld)l/vx;
    ld t2 = (ld)r/vx;
    wY1 = vy*t1 + G*t1*t1/2;
    wY2 = vy*t2 + G*t1*t1/2;

    if(wY1>t) rs1 = 1;
    else if ((b<=wY1)&&(wY1<=t)) rs1 = 0;
    else if(wY1 < b) rs1 = -1;
    if(wY2>t) rs2 = 1;
    else if ((b<=wY2)&&(wY2<=t)) rs2 = 0;
    else if(wY2 < b) rs2 = -1;
  }

  ld t3 = X/vx;
  ld wY3 = vy*t3 + G*t3*t3/2;
    //cout << wY1 << "  " << wY2 << "  " << wY3;// <<endl;
  if(wY3<Y) {//cout <<"todokanai"<<endl;
    return -1;
  }
  else {//cout << rs1 << " " <<rs2<<endl; 
    return rs1 * rs2;
  }
}
int main(){
  cin >> N >> V >> X >> Y;
  vector<int> L(N),B(N),R(N),T(N);
  REP(i,N){
    cin >> L[i] >> B[i] >> R[i] >> T[i];
    R[i] = min(R[i],X)
  }
  int flag = 1;
  REP(i,N){
    if((L[i]<=X)&&(X<=R[i])&&(B[i]>Y)) {
      flag = -1;
    }
  }
  if(flag == 1){
    int flag2 = 0;
    REP(i,N){
      REP(j,N){
        if(check(L[i],T[i],L[j],R[j],B[j],T[j])>0) flag2 = 1;
        //if(check(L[i],B[i],L[j],R[j],B[j],T[j])>0) flag2 = 1;
        if(check(R[i],T[i],L[j],R[j],B[j],T[j])>0) flag2 = 1;
        //if(check(R[i],B[i],L[j],R[j],B[j],T[j])>0) flag2 = 1;
      }
    }
    if(flag2==0) flag = -1;
    //cout << flag2 <<endl;
    if((N==0)||(flag==1)) cout << "Yes" <<endl;
    else cout << "No" <<endl;
  }else{
    cout << "No" <<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:23: error: expected ';' before '}' token
   64 |     R[i] = min(R[i],X)
      |                       ^
      |                       ;
   65 |   }
      |   ~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP(i,n,0)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 100000000

typedef long long ll;

int n, v, x, y;
int l[50], b[50], r[50], t[50];
double g = 9.8;

double cmp(double l, double u, double a) {
    return a < l ? -1 : a > u ? 1 : 0;
}

double height(double vy, double t) {
    return vy * t - g * t * t / 2;
}

bool solve(int bx, int by) {
    int i, j;
    if (v*v-2*g*by < 0)
        return false;
    for (int i = -1; i <= 1; i+=2) {
        double t2 = (-2*(g*by-v*v)+i*v*sqrt(v*v-2*g*by))/(g*g);
        if (t2 < 0)
            continue;
        double t1 = sqrt(t2);
        double vx = bx / t1;
        double vy = y/t1 + g*t1/2;
        if (height(vy,x/vx) < y-1e-9) continue;
        bool ok = true;
        rep (j,n) {
            if (l[j] >= x) continue;
            if (r[j] == x && height(vy,x/vx) >= b[j] && y <= t[j]) ok = false;
            int yL = cmp(b[j],t[j],height(vy,l[j]/vx));
            int yR = cmp(b[j],t[j],height(vy,r[j]/vy));
            int xH = cmp(l[j],r[j],vx*vy/g);
            int yH = cmp(b[j],t[j],height(vy,vy/g));
            if (yL*yR <= 0) ok = false;
            if (yR < 0 && xH == 0 && yH >= 0) ok = false;
        }
        if (ok) return true;
    }
    return false;
}

int main() {
    int i;
    bool ans;
    cin >> n >> v >> x >> y;
    rep (i,n) cin >> l[i] >> b[i] >> r[i] >> t[i];
    rep (i,n) r[i] = min(r[i],x);
    ans = solve(x,y);
    rep (i,n) {
        ans |= solve(l[i],t[i]);
        ans |= solve(r[i],t[i]);
    }
    if (ans)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'bool solve(int, int)':
a.cc:31:40: error: 'sqrt' was not declared in this scope
   31 |         double t2 = (-2*(g*by-v*v)+i*v*sqrt(v*v-2*g*by))/(g*g);
      |                                        ^~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
#include <stack>
#include <queue>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <list>
#include <string.h>
using namespace std;
typedef long long int ll; typedef pair <double, double> P;
const int INF = 1000000000; const double EPS = 10e-9;
const double g = 9.8;
int n, v, X, Y;
struct block {
	int l, b, r, t;
	block(int L, int B, int R, int T)
	{
		l = L; b = B; r = R; t = T;
	}
	block() {};
};
block bl[50];
double calc(double vy, double t)
{
	return vy * t - g * t * t / 2;
}
int comp(double lb, double rb, double a)
{
	return lb + EPS > a ? -1 : rb - EPS < a ? 1 : 0;
}
bool check(int x, int y)
{
	double a = g * g / 4, b = g * y - v * v, c = x * x + y * y;
	double D = b * b - 4 * a * c;
	if (D > -EPS && D < 0) D = 0;
	if (D < 0) return false;
	for (int d = -1; d <= 1; d += 2)
	{
		double t2 = (-b + d * sqrt(D)) / (2 * a);
		if (t2 <= 0) continue;
		double t = sqrt(t2);
		double vx = x / t;
		double vy = sqrt(v * v - vx * vx);
		double loc = calc(vy, X / vx);
		if (loc < Y - EPS) continue;
		bool res = true;
		for (int i = 0; i < n; i++)
		{
			if (bl[i].l >= X) continue;
			if( X =< bl[i].r && loc >= bl[i].b  && bl[i].t  >= Y) res = false;
			//if (!(bl[i].l <= X && X <= bl[i].r && loc >= bl[i].b - EPS && bl[i].t + EPS >= Y)) res = false;
			int lh = comp(bl[i].b, bl[i].t, calc(vy, bl[i].l / vx));
			int rh = comp(bl[i].b, bl[i].t, calc(vy, bl[i].r / vx));
			int mw = comp(bl[i].l, bl[i].r, vx* vy / g);
			int mh = comp(bl[i].b, bl[i].t, calc(vy, vy / g));
			if (lh * rh <= 0) res = false;
			if (mw == 0 && lh < 0 && mh >= 0) res = false;
		}
		if (res) return res;
	}
	return false;
}
int main() 
{
	cin >> n >> v >> X >> Y;
	for (int i = 0; i < n; i++)
	{
		int l, b, r, t; cin >> l >> b >> r >> t;
		bl[i] = block(l, b, r, t);
	}
	bool res = check(X, Y);
	for (int i = 0; i < n; i++)
	{
		res |= check(bl[i].l, bl[i].t);
		res |= check(bl[i].r, bl[i].t);
	}
	puts(res ? "Yes" : "No");
	return 0;
}

Compiler output:
a.cc: In function 'bool check(int, int)':
a.cc:53:32: error: expected primary-expression before '<' token
   53 |                         if( X =< bl[i].r && loc >= bl[i].b  && bl[i].t  >= Y) res = false;
      |                                ^
Language: C++

#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int Maxn=60;

const double g=9.8;
const double eps= 1e-8;

int N; double V,X,Y;

double L[Maxn],B[Maxn],R[Maxn],T[Maxn];

double Calcy(double vy,double t){return vy*t-0.5*g*t*t;}
double Calcx(double vx,double t){return vx*t;}

int cmp(double lb,double ub,double a)
{
  return a<lb ? -1 : a>ub-eps ? 1 : 0;
}

bool Check(double x,double y) // ????????????(x,y) 
{
  double a=0.25*g*g; double b=g*y-V*V; double c=x*x+y*y;
  double delta= b*b-4*a*c;
  if(delta < 0) return 0;
  for(int op=-1;op<=1;op+=2)
  {
    double t=sqrt((-b+sqrt(delta)*op)/(2.0*a));
    if(t<=0) continue;
    double vx=x/t; double vy=(y+0.5*g*t*t)/t; //?????????
    double yt=Calcy(vy,X/vx); //???????¨?????????????
   	if(yt < Y-eps) continue;
   	bool ok=1;
   	for(int i=1;i<=N;i++)
   	{
   	  if(L[i] >= X) continue;
   	  if(R[i] == X && yt >= T[i] && B[i] >= Y){ok=0; break;}
   	  int yL=cmp(B[i],T[i],Calcy(vy,L[i]/vx));
   	  int yR=cmp(B[i],T[i],Calcy(vy,R[i]/vx));
   	  int xH=cmp(L[i],R[i],Calcx(vx,vy/g));
   	  int yH=cmp(B[i],T[i],Calcy(vy,vy/g));
   	  if( xH == 0 && yH >= 0){ok=0; break;}
   	  if(yL * yR <=0){ok=0; break;}
   	}
   	if(ok) return 1;
  } 
  return 0;
}

int main()
{

  scanf("%d%lf%lf%lf",&N,&V,&X,&Y);
  for(int i=1;i<=N;i++) scanf("%lf%lf%lf%lf",&L[i],&B[i],&R[i],&T[i]);

  for(int i=1;i<=N;i++) R[i]=min(R[i],X);

  bool ok=0;
  ok=Check(X,Y);

  for(int i=1;i<=N;i++)
  {
    ok|=Check(L[i],T[i]);
    ok|=Check(R[i],T[i]);
  }

  puts(ok ? "Yes" : "No");

  return 0;
}

Compiler output:
a.cc: In function 'bool Check(double, double)':
a.cc:32:23: error: 'sqrt' was not declared in this scope
   32 |     double t=sqrt((-b+sqrt(delta)*op)/(2.0*a));
      |                       ^~~~
a.cc:32:14: error: 'sqrt' was not declared in this scope
   32 |     double t=sqrt((-b+sqrt(delta)*op)/(2.0*a));
      |              ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const double g = 9.8;
const double eps = 1e-10;
double calc(double vy, double t){
    return vy * t - 0.5 * g * t * t;
}
const int N = 60;
int n;
double v,x,y, fy;
double L[N],B[N],R[N],T[N],sR[i];

bool cmp(int i, double vx, double vy) {
    if (L[i] > x || L[i] > R[i]) return true;
    if (sR[i] > x && fy > T[i] && y < T[i]) return false;
    double yl = calc(vy, L[i] / vx), yr = calc(vy, R[i] / vx);
    if (yl > T[i] && yr > T[i]) return true;
    if (yl < B[i] && yr < B[i]) {
        double tx = vx * vy / g;
        if (tx > R[i] || tx < L[i]) return true;
        return calc(vy, vy / g) < B[i];
    }
    return false;
}


bool check(double qx, double qy) {
    double A = g * g, B = 4 * qy * g - 4 * v * v, C = 4 * (qx *qx + qy * qy);
    double delta = B * B - 4 * A * C;
    if (delta < 0) return false;
    for (int co = -1; co <= 1; co+=2) {
        double t2 = (-B+co * sqrt(delta)) / (2 * A);
        if (t2 < 0) continue;
        double t = sqrt(t2);
        double vx = qx / t, vy = sqrt(v*v - vx * vx);
        fy = calc(vy, x / vx);
        if (fy + eps < y) continue;
        bool ok = true;
        for (int i = 0; i < n;i++) {
            if (!cmp(i,vx,vy)) {
                ok = false;
                break;
            }   
        }
        if (ok) return true;
    }
    return false;
}


int main() {
    scanf("%d%lf%lf%lf", &n, &v, &x, &y);
    for (int i = 0; i < n; i++) {
        scanf("%lf%lf%lf%lf", L + i, B + i, R + i, T + i);
        sR[i] = R[i];
        R[i] = min(x,R[i]);
    }
    bool ok = false;
    ok |= check(x,y);
    for (int i = 0; i < n && !ok; i++) {
        ok |= check(L[i],B[i]);
        ok |= check(L[i],T[i]);
        ok |= check(R[i],B[i]);
        ok |= check(R[i],T[i]);
    }
    if (ok) {
        puts("Yes");
    }
    else {
        puts("No");
    }
    



}


Compiler output:
a.cc:11:31: error: 'i' was not declared in this scope
   11 | double L[N],B[N],R[N],T[N],sR[i];
      |                               ^
a.cc: In function 'bool cmp(int, double, double)':
a.cc:15:9: error: 'sR' was not declared in this scope; did you mean 'R'?
   15 |     if (sR[i] > x && fy > T[i] && y < T[i]) return false;
      |         ^~
      |         R
a.cc: In function 'int main()':
a.cc:55:9: error: 'sR' was not declared in this scope; did you mean 'R'?
   55 |         sR[i] = R[i];
      |         ^~
      |         R
Language: C++

#include <iostream>
#include<cmath>
#include<cstdio>
using namespace std;
#define g 9.80
#define eps 1e-8
int top;

int n;
double v,xx,yy;

struct point
{
       double x,y;
}p[201];

struct rectangle
{
       double l,r,b,t;
}rec[101];

bool judge(double a,double len )
{
     int i;
     for ( i=1;i<=top;i++ )
         if ( p[i].y-a*p[i].x*(p[i].x-len)>eps )
            return false;
     return true;
}


void bs()
{
     double l=0,r=v,mid = (l+r)/2;
     double t,vx,vy,len;
     vy=v;
     while ( r-l>eps )
     {
           mid = (l+r)/2;
           vy=mid;
           vx=sqrt(v*v-vy*vy);
           t=vy/g;
           len = vx*2*t;
           if ( len<xx )
              r=mid;
           else
           {
               double a = (-2*vy*vy)/(g*len*len);
               if ( judge(a,len) )
               {
                    printf("Yes\n");
                    return ;
               }
               else
                   l=mid;
           }
     }
     printf("No\n");
}

int main()
{
    int i;
    while ( scanf("%d %lf %lf %lf",&n,&v,&xx,&yy)!=EOF )
    {
          top=0;
          memset(p,0,sizeof(p));
          for ( i=1;i<=n;i++ )
              scanf("%lf %lf %lf %lf",&rec[i].l,&rec[i].b,&rec[i].r,&rec[i].t);
          for ( i=1;i<=n;i++ )
          {
              if( rec[i].l-xx>eps ) continue;
              p[++top].x=rec[i].l,p[top].y=rec[i].t;
              if ( rec[i].r-xx>eps ) continue;
              p[++top].x=rec[i].r,p[top].y=rec[i].t;
          }
          p[++top].x=xx;
          p[top].y=yy;
          bs();
    }
    return 0;
}
          
          
          
          

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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;
const double g = 9.8;
const double EPS = 1e-8;
namespace solver{
    int n;
    double v, gx, gy;
    double x1[50], x2[50], y1[50], y2[50];

    double calc_y(double vx, double vy, double x){
        double t = x / vx;
        return vy * t - g * t * t / 2;
    }

    int sign(double x){
        if(x > EPS) return 1;
        if(x < -EPS) return -1;
        return 0;
    }
    
    int comp(double lb, double ub, double x){
        if(x < lb + EPS) return -1;
        if(x > ub - EPS) return 1;
        return 0;
    }

    bool check(double bx, double by){
        double a = g * g / 4.0;
        double b = g * by - v * v;
        double c = bx * bx + by * by;
        double D = b * b - 4 * a * c;
        //printf("D:%f\n", D);
        if(D < 0) return false;
        for(int s = -1; s <= 1; s += 2){
            double tt = (-b + s * sqrt(D)) / (2 * a);
            //printf("tt:%f\n", tt);
            if(tt < 0) continue;
            double t = sqrt(tt);
            double vx = bx / t;
            double vy = (by + g * t * t / 2) / t;
            assert(sign(vx * vx + vy * vy - v * v) == 0);
            double fh = calc_y(vx, vy, gx);
            if(sign(fh - gy) < 0) continue;
            bool ok = true;
            for(int i = 0; i < n; i++){
                if(x1[i] >= gx) continue;
                if(comp(x1[i], x2[i], gx) == 0 && comp(y1[i], y2[i], gy) <= 0 && comp(y1[i], y2[i], gh) >= 0) {
                    ok = false;
                }
                int yl = comp(y1[i], y2[i], calc_y(vx, vy, x1[i]));
                int yr = comp(y1[i], y2[i], calc_y(vx, vy, x2[i]));
                int xh = comp(x1[i], x2[i], vx * vy / g);
                int yh = comp(y1[i], y2[i], calc_y(vx, vy, vx * vy / g));
                if(xh == 0 && yh >= 0 && yl <= 0) ok = false;
                if(yl * yr <= 0) ok = false;
            }
            if(ok) return true;
        }
        return false;
    }
    bool solve(){
        cin >> n;
        cin >> v >> gx >> gy;
        REP(i, n) cin >> x1[i] >> y1[i] >> x2[i] >> y2[i];
        REP(i, n) x2[i] = min(x2[i], gx);
        bool ans = false;
        ans |= check(gx, gy);
        REP(i, n){
            ans |= check(x1[i], y2[i]);
            ans |= check(x2[i], y2[i]);
        }
        return ans;
    }
}

int main(){
    cout << (solver::solve() ? "Yes" : "No") << endl;
    return 0;
}

Compiler output:
a.cc: In function 'bool solver::check(double, double)':
a.cc:49:101: error: 'gh' was not declared in this scope; did you mean 'fh'?
   49 |                 if(comp(x1[i], x2[i], gx) == 0 && comp(y1[i], y2[i], gy) <= 0 && comp(y1[i], y2[i], gh) >= 0) {
      |                                                                                                     ^~
      |                                                                                                     fh
Language: C++

#include <bits/stdC++.h>
using namespace std;
const int N = 105, M = N * N;
const double inf = 1000, eps = 1e-8;
//最小?形?
int n, m, tot, pre[N], vis[N], id[N];
double in[N], v[N][N];
struct Edge {
	int u, v;
	double dis;
	Edge(){}
	Edge(int u, int v, double dis): u(u), v(v), dis(dis){};
}e[M];
int sgn(double x) {
	if (fabs(x) < eps)	return 0;
	return x < 0 ? -1 : 1;
}
double MST(int root) {
	double t = 0.0;
	while (1) {
		for (int i = 1; i <= n; ++i)	in[i] = inf;
		for (int i = 1; i <= tot; ++i) {
			int u = e[i].u;
			int v = e[i].v;
			if (sgn(e[i].dis - in[v]) < 0 && u != v) {
				pre[v] = u;
				in[v] = e[i].dis;
			}
		}
		for (int i = 1; i <= n; ++i) {
			if (i == root)	continue;
			if (sgn(in[i] - inf) == 0)	return -1;
		}
		//find cycle
		int cnt = 0;
		memset(id, -1 ,sizeof(id));
		memset(vis, -1 ,sizeof(vis));
		in[root] = 0;
		for (int i = 1; i <= n; ++i) {
			t += in[i];
			int v = i;
			while (vis[v] != i && id[v] == -1 && v != root) {
				vis[v] = i;
				v = pre[v];
			}
			if (v != root && id[v] == -1) {
				for (int u = pre[v]; u != v; u = pre[u])	id[u] = ++cnt;
				id[v] = cnt;
			}
		}
		if (!cnt)	break;//no cycle
		for (int i = 1; i <= n; ++i)
			if (id[i] == -1)	id[i] = ++cnt;
		for (int i = 1; i <= tot; ++i) {
			int v = e[i].v;
			e[i].u = id[e[i].u];
			e[i].v = id[e[i].v];
			if (e[i].u != e[i].v)	e[i].dis -= in[v];
		}
		n = cnt;
		root = id[root];
	}
	return t;
}
double dot(int x, int y) {
	double t = 0.0;
	for (int i = 1; i <= m; ++i)	t += v[x][i] * v[y][i];
	return t;
}
double norm(int x) {
	return dot(x, x);
}
double sqr(double x) {
	return x * x;
}
int main() {
	scanf("%d%d", &m, &n);
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j)
			scanf("%lf", &v[i][j]);
	int rt = n + 1;
	for (int i = 1; i <= n; ++i)	e[++tot] = Edge(rt, i, norm(i));
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j) {
			if (i == j)	continue;
			if (norm(i) == 0)	e[++tot] = Edge(i, j, norm(j));
			else e[++tot] = Edge(i, j, norm(j) - sqr(dot(i, j)) / norm(i));
		}
	printf("%.10lf\n", MST(rt));
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits/stdC++.h: No such file or directory
    1 | #include <bits/stdC++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

const double EPS = 1e-8;

int main(){
	int H, W;
	string f[600];
	while(cin >> H >> W){
		for(int i=H-1;i>=0;i--) cin >> f[i];

		vector< pair<double, int> > vd;
		// ????????°??????????????????????????????.
		// ??????(j/i)?????§??????????????¨??????????????°????¢????????????£?????????
		for(int i=1;i<=H;i++){
			for(int j=0;j<=W;j++){
				int cnt = 0;
				for(int k=0;k<4;k++){
					int ni = i-k%2, nj = j-k/2;
					if(0<=ni&&ni<H&&0<=nj&&nj<W&&f[ni][nj]=='#') cnt++;
				}
				if(cnt%2 == 1){
					if(0<=i-1&&i-1<H&&0<=j&&j<W&&f[i-1][j]==(cnt==1?'#':'.'))
						vd.push_back(make_pair((double)j/i,  1));
					if(0<=i&&i<H&&0<=j-1&&j-1<W&&f[i][j-1]==(cnt==1?'#':'.'))
						vd.push_back(make_pair((double)j/i, -1));
				}
			}
		}
		sort(vd.begin(), vd.end());

		int res = 1, cur = 1;
		// ???????????§?????????????????????????????°????¢????????????????
		for(int i=0;i<vd.size(); ){
			int idx = i;
			while(idx < vd.size() && abs(vd[i].first-vd[idx].first) < EPS)
				cur += vd[idx++].second;
			i = idx;
			res = max(cur, res);
		}
		cout << res << endl;
	}
}

Compiler output:
Main.java:2: error: illegal character: '#'
#include <iostream>
^
Main.java:3: error: illegal character: '#'
#include <vector>
^
Main.java:4: error: illegal character: '#'
#include <cmath>
^
Main.java:5: error: illegal character: '#'
#include <algorithm>
^
Main.java:9: error: class, interface, enum, or record expected
const double EPS = 1e-8;
^
Main.java:15: error: not a statement
		for(int i=H-1;i>=0;i--) cin >> f[i];
		                            ^
Main.java:46: error: not a statement
		cout << res << endl;
		            ^
Main.java:11: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:13: error: ']' expected
	string f[600];
	         ^
9 errors
Language: C++

#include <cmath>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int h, w;
	cin >> h >> w;

	vector<string> field(1, string(w + 1, '.'));
	field.reserve(h + 2);

	for(int i = 0; i < h; ++i) {
		string line;
		cin >> line;
		field.emplace_back(line + '.');
	}

	field.emplace_back(string(w + 1, '.'));

	typedef pair<double, bool> event; // arg, inc
	vector<event> events;

	const int oy = h;

	for(int i = 1; i < h + 2; ++i) {
		for(int j = 0; j < w; ++j) {
			if(field[i][j] == field[i - 1][j + 1]) {
				if(field[i][j] == field[i][j + 1] && field[i][j] != field[i - 1][j]) { // inc
					events.emplace_back(atan2(oy - (i - 1), j + 1), true);
				}
				else if(field[i][j] != field[i][j + 1] && field[i][j] == field[i - 1][j]) { // dec
					events.emplace_back(atan2(oy - (i - 1), j + 1), false);
				}
			}
		}
	}

	sort(events.begin(), events.end());

	int ans = 1;
	int cnt = 1;

	for(const auto &e : events) {
		if(e.second) {
			chmax(ans, ++cnt);
		}
		else {
			--cnt;
		}
	}

	cout << ans << endl;

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   45 |         sort(events.begin(), events.end());
      |         ^~~~
      |         sqrt
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
typedef double D;
int H,W;
string s[601];
D EPS=1e-8;
vector<D> ts;
bool dx[601][601],dy[601][601];
int main(){
	cin>>H>>W;
	rep(i,H) cin>>s[H-1-i];
	rep1(x,W) rep1(y,H){
		ts.pb((D)y/x+EPS);
		ts.pb((D)y/x-EPS);
	}
	s[H].assign(W,'.');
	rep(i,H+1) s[i]+='.';
	rep(i,H) rep(j,W+1) dx[i][j]=(s[i][j]==s[i+1][j]);
	rep(i,H+1) rep(j,W) dy[i][j]=(s[i][j]==s[i][j+1]);
	sort(all(ts));
	ts.erase(unique(all(ts)),ts.end());
	int mx=0;
	for(D t:ts){
		int cnt=0;
		rep1(x,W){
			int y=floor(t*x);
			if(y<H&&!dy[y][x-1]) cnt++;
		}
		rep1(y,H){
			int x=floor(y/t);
			if(x<W&&!dx[y-1][x]) cnt++;
		}
		mx=max(mx,cnt);
	}
	cout<<(mx+3)/2<<endl;
}
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
typedef double D;
int H,W;
string s[601];
D EPS=1e-8;
vector<D> ts;
int main(){
	cin>>H>>W;
	rep(i,H) cin>>s[H-1-i];
	rep1(x,W) rep1(y,H){
		ts.pb((D)y/x+EPS);
		ts.pb((D)y/x-EPS);
	}
	s[H].assign(W,'.');
	rep(i,H+1) s[i]+='.';
	sort(all(ts));
	ts.erase(unique(all(ts)),ts.end());
	int mx=0;
	for(D t:ts){
		int cnt=0;
		rep1(x,W){
			int y=floor(t*x);
			if(y<H&&s[y][x-1]!=s[y][x]) cnt++;
		}
		rep1(y,H){
			int x=floor(y/t);
			if(x<W&&s[y-1][x]!=s[y][x]) cnt++;
		}
		mx=max(mx,(cnt+1)/2+1);
	}
	cout<<mx<<endl;
}

Compiler output:
a.cc:69:5: error: redefinition of 'int H'
   69 | int H,W;
      |     ^
a.cc:23:5: note: 'int H' previously declared here
   23 | int H,W;
      |     ^
a.cc:69:7: error: redefinition of 'int W'
   69 | int H,W;
      |       ^
a.cc:23:7: note: 'int W' previously declared here
   23 | int H,W;
      |       ^
a.cc:70:8: error: redefinition of 'std::string s [601]'
   70 | string s[601];
      |        ^
a.cc:24:8: note: 'std::string s [601]' previously declared here
   24 | string s[601];
      |        ^
a.cc:71:3: error: redefinition of 'D EPS'
   71 | D EPS=1e-8;
      |   ^~~
a.cc:25:3: note: 'D EPS' previously defined here
   25 | D EPS=1e-8;
      |   ^~~
a.cc:72:11: error: redefinition of 'std::vector<double> ts'
   72 | vector<D> ts;
      |           ^~
a.cc:26:11: note: 'std::vector<double> ts' previously declared here
   26 | vector<D> ts;
      |           ^~
a.cc:73:5: error: redefinition of 'int main()'
   73 | int main(){
      |     ^~~~
a.cc:28:5: note: 'int main()' previously defined here
   28 | int main(){
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<tuple>
using namespace std;
int H, W, x[1000][1000], maxn = 1, cnt = 1;
vector<tuple<long double, int, int>>tup;
int analysis(int p, int q) {
	int D = x[p - 1][q - 1] * 1 + x[p - 1][q] * 2;
	D += x[p][q - 1] * 4 + x[p][q] * 8;
	if (D == 8 || D == 7)return 1;
	if (D == 1 || D == 14)return -1;
	return 0;
}
int main() {
	cin >> H >> W;
	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			char c; cin >> c; if (c == '#')x[i][j] = 1;
		}
	}
	for (int i = 1; i <= H + 1; i++) {
		for (int j = 1; j <= W + 1; j++) {
			int XX = (H + 1) - i, YY = j - 1;
			if (XX + YY == 0)continue;
			tup.push_back(make_tuple(1.0l*YY / XX, i, j));
		}
	}
	sort(tup.begin(), tup.end());
	for (int i = 0; i < tup.size(); i++) {
		int p = analysis(get<1>(tup[i]), get<2>(tup[i]));
		cnt += p;
		long double B = 0.0l;
		if (i < tup.size() - 1)B = fabs(get<0>(tup[i]) - get<0>(tup[i + 1]));
		if (i == (tup.size() - 1) || B > 1e-12) {
			maxn = max(maxn, cnt);
		}
	}
	cout << maxn << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:44: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   34 |                 if (i < tup.size() - 1)B = fabs(get<0>(tup[i]) - get<0>(tup[i + 1]));
      |                                            ^~~~
      |                                            labs