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

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

#define f first
#define s second
#define INF (1<<29)

using namespace std;

typedef pair<double,double>pii;

double dist(pii a,pii b){
  return sqrt(pow(a.f-b.f,2)+pow(a.s-b.s,2));
}

int main(void){
  
  int na,nb;
  cin >> na >> nb;
  
  vector<pii>a(na),b(nb);
  
  for(int i=0;i<na;i++)cin >> a[i].f >> a[i].s;
  for(int i=0;i<nb;i++)cin >> b[i].f >> b[i].s;
  
  double ans=INF,D;
  D=min(dist(a[0],b[0])+dist(b[0],a[1]),dist(a[0],b[1]),dist(b[1],a[1]));
  for(int i=2;i<na;i++){
    double d=dist(a[0],a[i])+dist(a[i],a[1]);
    if(d<D)ans=min(ans,d+dist(b[0],b[1]));
  }

  D=min(dist(b[0],a[0])+dist(a[0],b[1]),dist(b[0],a[1]),dist(a[1],b[1]));
  for(int i=2;i<nb;i++){
    double d=dist(b[0],b[i])+dist(b[i],b[1]);
    if(d<D)ans=min(ans,d+dist(a[0],a[1]));
  }
  
  printf("%.9f",ans);
  cout << endl;

  return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = double; _Compare = double]':
a.cc:30:8:   required from here
   30 |   D=min(dist(a[0],b[0])+dist(b[0],a[1]),dist(a[0],b[1]),dist(b[1],a[1]));
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C

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

#define MOD (1000000007)

typedef __int64 ll;
ll memo[220001];

void initTable(ll n)
{
    ll i;
    memo[1] = 1;
    for (i = 2; i <= n; i++){
        memo[(int)i] = (i * memo[(int)(i - 1)]) % MOD;
    }
}

ll extgcd(ll a, ll b, ll *x, ll *y)
{
    ll d = a;
    if (b != 0){
        d = extgcd(b, a % b, y, x);
        *y -= (a / b) * *x;
    }
    else {
        *x = 1;
        *y = 0;
    }
    return (d);
}

ll mod_inverse(ll a, ll m){
    ll x, y;
    extgcd(a, m, &x, &y);
    return ((m + x % m) % m);
}

ll mod_fact(ll n, ll p, ll *e)
{
    ll res;
    int look;
    *e = 0;
    if (n == 0){
        return (1);
    }
    
    res = mod_fact(n / p, p, e);
    *e += n / p;
    
    if (n / p % 2 != 0){
        return (res * (p - memo[(int)(n % p)]) % p);
    }
    look = n % p;
    return (res * memo[(int)(n % p)] % p);
}

ll mod_comb(ll n, ll k, ll p) {
    ll e1, e2, e3;
    ll a1, a2, a3;
    
    if (n < 0 || k < 0 || n < k){
        return (0);
    }
    
    a1 = mod_fact(n, p, &e1);
    a2 = mod_fact(k, p, &e2);
    a3 = mod_fact(n - k, p, &e3);
    
    if (e1 > e2 + e3){ //divisible
        return (0);
    }
    return (a1 * mod_inverse(a2 * a3 % p, p) % p);
}

int main(void)
{
    int x, y, k;
    int i, j;
    ll res;
    ll xgrid, ygrid;
    
    scanf("%d%d%d", &x, &y, &k);
    
    memset(memo, -1, sizeof(memo));
    initTable(x + y + 2 * k);
    memo[0] = 1;
    res = 0;
    
    for (i = 0; i <= k; i++){ // ãºÉy + 2 * iñ, ¶EÉ x + 2 * k - 2 * iñ®­
        xgrid = (mod_comb(x + 2 * (k - i) , k - i, MOD) - mod_comb(x + 2 * (k - i), k - i - 1, MOD) + MOD) % MOD;
        ygrid = (mod_comb(y + 2 * i, i, MOD) - mod_comb(y + 2 * i, i - 1, MOD) + MOD) % MOD;
        
        res = (res + ((xgrid * ygrid) % MOD) * mod_comb(x + y + 2 * k, y + 2 * i, MOD)) % MOD;
    }
    
    printf("%I64d\n", (res + MOD) % MOD);
    return (0);
}

Compiler output:
main.c:6:9: error: unknown type name '__int64'; did you mean '__int64_t'?
    6 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
Language: C++

#include <stdio.h>
#define mod 1000000007
int H, W, K, fact[100001], inv[100001], factiv[100001];
int ncr(int n, int r) { return r < 0 ? 0 : 1LL * fact[n] * factinv[r] % mod * factinv[n - r] % mod; }
int main() {
    scanf("%d%d%d", &H, &W, &K);
    fact[0] = 1;
    for(int i = 1; i <= 100000; i++) fact[i] = 1LL * fact[i - 1] * i % mod;
    inv[1] = 1;
    for(int i = 2; i <= 100000; i++) inv[i] = 1LL * inv[mod % i] * (mod - mod / i) % mod;
    factinv[0] = 1;
    for(int i = 1; i <= 100000; i++) factinv[i] = 1LL * factinv[i - 1] * inv[i] % mod;
    int ret = 0;
    for(int i = 0; i <= K; i++) {
        int re1 = (ncr(W + i, i) - ncr(W + i, i - 1) + mod) % mod;
        int re2 = (ncr(H + K - i, K - i) - ncr(H + K - i, K - i - 1) + mod) % mod;
        ret += 1LL * ncr(H + W + K, W + i) * re1 % mod * re2 % mod;
        ret %= mod;
    }
    printf("%d\n", ret);
    return 0;
}

Compiler output:
a.cc: In function 'int ncr(int, int)':
a.cc:4:60: error: 'factinv' was not declared in this scope; did you mean 'factiv'?
    4 | int ncr(int n, int r) { return r < 0 ? 0 : 1LL * fact[n] * factinv[r] % mod * factinv[n - r] % mod; }
      |                                                            ^~~~~~~
      |                                                            factiv
a.cc: In function 'int main()':
a.cc:11:5: error: 'factinv' was not declared in this scope; did you mean 'factiv'?
   11 |     factinv[0] = 1;
      |     ^~~~~~~
      |     factiv
Language: C++

#include<iostream>
using namespace std;
#define MOD 1000000007
long long fact[500000];
long long inv[500000];
long long factinv[500000];
long long ncr(int a,int b){
	if(b<0 || a<b)return 0;
	return 1LL*fact[a]*factinv[b]%MOD*factinv[a-b]%MOD; 
}
long long ktrn(int a,int b){
	return (ncr(a+b,b)-ncr(a+b,b-1)+MOD)%MOD;
}
int main(){
	fact[0]=1;inv[1]=1;factinv[0]=1;
	for(long long i=1;i<500000;i++){
		fact[i]=fact[i-1]*i;
		fact[i]%=MOD;
	}
	for(long long i=2;i<500000;i++){
		inv[i]=1LL*inv[MOD%i]*(MOD-MOD/i)%MOD;
	}
	for(long long i=1;i<500000;i++){
		factinv[i]=1LL*factinv[i-1]*inv[i]%MOD;
	}
	int n,m,k;
	cin>>n>>m>>k;
	dp[0][0]=1;
	for(int i=0;i<=1500;i++){p[i][0]=1;p[i][i]=1;}
	for(int i=1;i<=1500;i++){
		for(int j=0;j<=i;j++){
			dp[i][j]=dp[i-1][j]+dp[i][j-1];
			dp[i][j]%=MOD;
			if(j>=1 && j<i){
				p[i][j]=p[i-1][j-1]+p[i-1][j];
				p[i][j]%=MOD;
			}
		}
	}
	long long sum=0;
	for(int i=0;i<=k;i++){
		long long V=ncr(n+m+k*2,n+i*2)*ktrn(n+i,i);V%=MOD;
		V*=ktrn(m+k-i,k-i);sum+=V;sum%=MOD;
		//cout<<p[n+m+k*2][n+i*2]<<' '<<dp[n+i][i]<<' '<<dp[m+k-i][k-i]<<endl;
	}
	cout<<sum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'dp' was not declared in this scope
   28 |         dp[0][0]=1;
      |         ^~
a.cc:29:34: error: 'p' was not declared in this scope
   29 |         for(int i=0;i<=1500;i++){p[i][0]=1;p[i][i]=1;}
      |                                  ^
a.cc:35:33: error: 'p' was not declared in this scope
   35 |                                 p[i][j]=p[i-1][j-1]+p[i-1][j];
      |                                 ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<int,int,int> tp;
//typedef vector<tp> vt;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
const ll INF=2e18;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
#define MOD 1000000007
// a^b mod MOD
ll powmod(ll a,ll b){
	ll out=1;
	ll p=a%MOD;
	while(b){
		if(b&1)out=out*p%MOD;
		p=p*p%MOD;
		b>>=1;
	}
	return out;
}
#define M 210000
vector<ll> fact;
void init(){
	fact=vector<ll>(M);
	fact[0]=fact[1]=1;
	loop(i,2,M)fact[i]=fact[i-1]*i%MOD;
}
// nCr
ll nCr(ll n,ll r){
	if(n<r)return 1;
	ll out=fact[n]*powmod(fact[r]*fact[n-r]%MOD,MOD-2)%MOD;
	return out;
}
int main(){
    d=vector<ll>(210000);
    d[0]=d[1]=1;
    for(ll i=2;i<210000;i++)d[i]=d[i-1]*i%MOD;
    ll n,m,x;
    cin>>n>>m>>x;
    ll out=0;
    for(ll i=0;i<x+1;i++){
        ll t=1;
        (t*=(nCr(n+2*i,i)-nCr(n+2*i,i-1)+MOD)%MOD)%=MOD;
        (t*=(nCr(m+2*(x-i),x-i)-nCr(m+2*(x-i),x-i-1)+MOD)%MOD)%=MOD;
        (t*=nCr(n+m+2*x,n+2*i))%=MOD;
        (out+=t)%=MOD;
    }
    cout<<out<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:5: error: 'd' was not declared in this scope; did you mean 'vd'?
   70 |     d=vector<ll>(210000);
      |     ^
      |     vd
Language: C

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



class C{
public:
	int x,y;
	C(int x,int y):x(x),y(y){}
};
const int dx[]={1,0,-1,0};
const int dy[]={0,1,0,-1};

int w,h;

bool in(int x,int y){
	if(x<0 || y<0 || x>=w || y>=h) return false;
	return true;
}

double e[500][500];
long long int dist_goal[500][500],dist_spring[500][500];

const long long INF=10000000000;

int main()
{
/*	double m=1000000000000.0;
	for(int i=0;i<1000;i++){
		cout<<m<<endl;
		m/=2.0;
	}*/

	cin>>w>>h;
	int gx,gy,sx,sy;
	vector<string> M(h);
	vector<C> spring;
	long long num_normal=0;
	for(int i=0;i<h;i++){
		cin>>M[i];
		for(int j=0;j<M[i].size();j++){
			if(M[i][j]=='s'){sx=j;sy=i;num_normal++;}
			if(M[i][j]=='g'){gx=j;gy=i;}
			if(M[i][j]=='*'){spring.push_back(C(j,i));}
			if(M[i][j]=='.'){num_normal++;}
		}
	}

	for(long long i=0;i<500;i++)
		for(long long j=0;j<500;j++){
			e[i][j]=INF;
			dist_goal[i][j]=INF;
			dist_spring[i][j]=INF;
		}

	bool visit[500][500];
	memset(visit,false,sizeof(visit));

	queue<pair<C,long long> > que;
	que.push(make_pair(C(gx,gy),0));

	while(!que.empty()){
		C now=que.front().first;
		int cost=que.front().second;
		que.pop();
		if(!in(now.x,now.y)) continue;
		if(M[now.y][now.x]=='#' || M[now.y][now.x]=='*') continue;
		if(visit[now.y][now.x]) continue;
		visit[now.y][now.x]=true;
		dist_goal[now.y][now.x]=cost;
		e[now.y][now.x]=cost;
		for(long long r=0;r<4;r++){
			que.push(make_pair(C(now.x+dx[r],now.y+dy[r]),cost+1));
		}
	}
	
	for(long long i=0;i<spring.size();i++)
		que.push(make_pair(C(spring[i].x,spring[i].y),0));
	memset(visit,false,sizeof(visit));
	while(!que.empty()){
		C now=que.front().first;
		long long cost=que.front().second;
		que.pop();
		if(!in(now.x,now.y)) continue;
		if(M[now.y][now.x]=='#') continue;
		if(visit[now.y][now.x]) continue;
		visit[now.y][now.x]=true;
		dist_spring[now.y][now.x]=cost;
		for(long long r=0;r<4;r++){
			que.push(make_pair(C(now.x+dx[r],now.y+dy[r]),cost+1));
		}
	}

	const int NUM=100;
	double upper=100000000000,lower=0;
	for(int t=0;t<NUM;t++){
		double sum=0.0;
		double E=(upper+lower)/2.0;
		for(int y=0;y<h;y++){
			for(int x=0;x<w;x++){
				if(M[y][x]!='.' && M[y][x]!='s') continue;
				if(dist_goal[y][x]<INF) sum+=min((double)dist_goal[y][x],dist_spring[y][x]+E);
				else sum+=dist_spring[y][x]+E;
			}
		}
//		cout<<sum/num_normal<<endl;
		if(sum/num_normal<E) upper=E;
		else lower=E;
	}
	cout<<min((double)dist_goal[sy][sx],(upper+lower)/2.0+dist_spring[sy][sx])<<endl;
	printf("%.13lf\n",min((double)dist_goal[sy][sx],(upper+lower)/2.0+dist_spring[sy][sx]));
	return 0;
}

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

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

class C{
public:
	int x,y;
	C(int x,int y):x(x),y(y){}
};
const int dx[]={1,0,-1,0};
const int dy[]={0,1,0,-1};

int w,h;

bool in(int x,int y){
	if(x<0 || y<0 || x>=w || y>=h) return false;
	return true;
}

long long int dist_goal[500][500],dist_spring[500][500];

const long long INF=10000000000LL;

int main()
{
/*	double m=1000000000000.0;
	for(int i=0;i<1000;i++){
		cout<<m<<endl;
		m/=2.0;
	}*/

	cin>>w>>h;
	int gx,gy,sx,sy;
	vector<string> M(h);
	vector<C> spring;
	long long num_normal=0;
	for(int i=0;i<h;i++){
		cin>>M[i];
		for(int j=0;j<M[i].size();j++){
			if(M[i][j]=='s'){sx=j;sy=i;num_normal++;}
			if(M[i][j]=='g'){gx=j;gy=i;}
			if(M[i][j]=='*'){spring.push_back(C(j,i));}
			if(M[i][j]=='.'){num_normal++;}
		}
	}

	for(int i=0;i<500;i++)
		for(int j=0;j<500;j++){
			dist_goal[i][j]=INF;
			dist_spring[i][j]=INF;
		}

	bool visit[500][500];
	memset(visit,false,sizeof(visit));

	queue<pair<C,int> > que;
	que.push(make_pair(C(gx,gy),0));

	while(!que.empty()){
		C now=que.front().first;
		int cost=que.front().second;
		que.pop();
		if(!in(now.x,now.y)) continue;
		if(M[now.y][now.x]=='#' || M[now.y][now.x]=='*') continue;
		if(visit[now.y][now.x]) continue;
		visit[now.y][now.x]=true;
		dist_goal[now.y][now.x]=cost;
		for(long long r=0;r<4;r++){
			que.push(make_pair(C(now.x+dx[r],now.y+dy[r]),cost+1));
		}
	}
	
	for(long long i=0;i<spring.size();i++)
		que.push(make_pair(C(spring[i].x,spring[i].y),0));
	memset(visit,false,sizeof(visit));
	while(!que.empty()){
		C now=que.front().first;
		long long cost=que.front().second;
		que.pop();
		if(!in(now.x,now.y)) continue;
		if(M[now.y][now.x]=='#') continue;
		if(visit[now.y][now.x]) continue;
		visit[now.y][now.x]=true;
		dist_spring[now.y][now.x]=cost;
		for(int r=0;r<4;r++){
			que.push(make_pair(C(now.x+dx[r],now.y+dy[r]),cost+1));
		}
	}

	const int NUM=1000;
	long double upper=1e20,lower=0.0;
	for(int t=0;t<NUM;t++){
		long double sum=0.0;
		long double E=(upper+lower)/2.0;
		vector<long double> work;
		for(int y=0;y<h;y++){
			for(int x=0;x<w;x++){
				if(M[y][x]!='.' && M[y][x]!='s') continue;
				if(dist_goal[y][x]<INF) work.push_back(min((double)dist_goal[y][x],(double)dist_spring[y][x]+(double)E));
				else work.push_back(dist_spring[y][x]+E);
			}
		}
//		sort(work.begin(),work.end());
		for(int i=0;i<work.size();i++)
			sum+=work[i];
//		cout<<sum/num_normal<<endl;
		if(sum/num_normal<E) upper=E-1e-10;
		else lower=E+1e-10;
	}
//	cout<<min((double)dist_goal[sy][sx],(upper+lower)/2.0+dist_spring[sy][sx])<<endl;
	printf("%.13lf\n",min((double)dist_goal[sy][sx],(double)(upper+lower)/2.0+dist_spring[sy][sx]));
	return 0;
}

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

#include<cstdio>
#include<queue>
#include<vector>
#include<algorithm>

using namespace std;

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

char field[550][550];
int H,W;

int dis[550][550],dis2[550][550];
vector<int> si,sj;

void bfs(int res[550][550]){
	for(int i=0;i<H;i++) for(int j=0;j<W;j++) res[i][j]=-1;
	queue<int> qi,qj;
	for(int i=0;i<si.size();i++){
		qi.push(si[i]);
		qj.push(sj[i]);
		res[si[i]][sj[i]]=0;
	}
	while(!qi.empty()){
		int i=qi.front();
		qi.pop();
		int j=qj.front();
		qj.pop();
		int c=res[i][j];
		for(int k=0;k<4;k++){
			int nc=c+1;
			int ni=i+dx[k];
			int nj=j+dy[k];
			if(field[ni][nj]!='.') continue;
			if(res[ni][nj]!=-1&&res[ni][nj]<=nc) continue;
			res[ni][nj]=nc;
			qi.push(ni);
			qj.push(nj);
		}
	}
}

bool check(double x){
	int cnt=0;
	double sum=0;
	vector<double> vec;
	for(int i=0;i<H;i++) for(int j=0;j<W;j++){
		if(field[i][j]!='.') continue;
		double tmp=1e11;
		if(dis[i][j]!=-1){
			tmp=dis[i][j];
		}
		if(dis2[i][j]!=-1){
			tmp=min(tmp,x+dis2[i][j]);
		}
	//	sum+=tmp;
		vec.push_back(tmp);
		cnt++;
	}
	sort(tmp.begin(),tmp.end());
	for(int i=0;i<cnt;i++) sum+=tmp[i];
	if(x<sum/cnt) return true;
	return false;
}

int main(){
	scanf("%d%d",&W,&H);
	for(int i=0;i<H;i++){
		scanf("%s",field[i]);
	}
	int sti=-1,stj=-1;
	int gi=-1,gj=-1;
	int cnt=0;
	for(int i=0;i<H;i++) for(int j=0;j<W;j++){
		if(field[i][j]=='s'){
			field[i][j]='.';
			sti=i,stj=j;
		}
		else if(field[i][j]=='g'){
			field[i][j]='#';
			gi=i,gj=j;
		}
		else if(field[i][j]=='*'){
			si.push_back(i);
			sj.push_back(j);
			cnt++;
		}
	}
	bfs(dis2);
	si.clear();
	sj.clear();
	si.push_back(gi);
	sj.push_back(gj);
	bfs(dis);
	if(cnt==0){
		printf("%d\n",dis[sti][stj]);
		return 0;
	}
//	for(int i=0;i<H;i++){
//		for(int j=0;j<W;j++) printf("%d ",dis[i][j]);
//		printf("\n");
//	}
	double lb=0,ub=1e10;
	for(int stage=0;stage<500;stage++){
		double mid=(ub+lb)/2;
		bool flg=check(mid);
		if(flg) lb=mid;
		else ub=mid;
	}
	double ans=1e10;
	if(dis[sti][stj]!=-1) ans=dis[sti][stj];
	if(dis2[sti][stj]!=-1) ans=min(ans,dis2[sti][stj]+lb);
	printf("%.9f\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'bool check(double)':
a.cc:60:14: error: 'tmp' was not declared in this scope
   60 |         sort(tmp.begin(),tmp.end());
      |              ^~~
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

vector<vector<int>>fi;

vector<vector<int>>spt, got;

struct aa {
	int y;
	int x;
	int time;
};
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,1,0,-1 };


class Compare {
public:
	//keiroが昇順に並ぶ
	bool operator()(const aa&l, const aa&r) {
		return l.time>r.time;
	}
};

int main() {
	int W, H; cin >> W >> H;
	int sx, sy;
	pair<int, int>gp;
	vector<pair<int, int>>sps;
	fi.resize(H);
	spt.resize(H);
	got.resize(H);
	for (int i = 0; i < H; ++i) {
		
		string st; cin >> st;
		for (int j = 0; j < W; ++j) {
			spt[i].emplace_back(999999);
			got[i].emplace_back(999999);
			int wh;
			if (st[j] == '.') {
				wh = 0;
			}
			else if (st[j] == '#') {
				wh = 1;
			}
			else if (st[j] == '*') {
				wh = 2;
				sps.push_back(make_pair(i, j));
			}
			else if (st[j] == 's') {
				wh = 0;
				sx = j; sy = i;
			}
			else if (st[j] == 'g') {
				wh = 4;
				gp.first = i;
				gp.second = j;
			}
			else {
				assert(false);
			}
			fi[i].push_back(wh);
		}
	}
	{
		priority_queue<aa, vector<aa>, Compare>que;
		for (int i = 0; i < sps.size(); ++i) {
			que.push(aa{ sps[i].first, sps[i].second, 0 });
			spt[sps[i].first][ sps[i].second] = 0;
		}

		while (!que.empty()) {
			aa atop(que.top());
			que.pop();
			for (int i = 0; i < 4; ++i) {
				const int nx = atop.x + dx[i];
				const int ny = atop.y + dy[i];
				const int nt = atop.time + 1;
				if (!fi[ny][nx]) {
					if (spt[ny][nx] > nt) {
						spt[ny][nx] = nt;
						que.push(aa{ ny,nx,nt });
					}
				}
			}

		}
	}
	{
		priority_queue<aa, vector<aa>, Compare>que;
		que.push(aa{ gp.first, gp.second, 0 });
		got[gp.first][gp.second] = 0;
		

		while (!que.empty()) {
			aa atop(que.top());
			que.pop();
			for (int i = 0; i < 4; ++i) {
				const int nx = atop.x + dx[i];
				const int ny = atop.y + dy[i];
				const int nt = atop.time + 1;
				if (!fi[ny][nx]) {
					if (got[ny][nx] > nt) {
						got[ny][nx] = nt;
						que.push(aa{ ny,nx,nt });
					}
				}
			}

		}
	}

	long double amin = 0;
	long double amax = 1000000000;
	while (amin + 1e-11 < amax) {
		long double amid = (amin + amax) / 2;

		long double timesum = 0;
		long double placesum = 0;
		for (int y = 0; y < H; ++y) {
			for (int x = 0; x < W; ++x) {
				if (!fi[y][x]) {
					placesum++;
					timesum += min(long double(got[y][x]), spt[y][x] + amid);
				}
			}
		}
		if (amid < timesum / placesum) {
			amin = amid;
		}
		else {
			amax = amid;
		}
	}
	long double ans = min(long double(got[sy][sx]), spt[sy][sx] + amin);
	cout <<fixed<<setprecision(22)<< ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:126:56: error: expected primary-expression before 'long'
  126 |                                         timesum += min(long double(got[y][x]), spt[y][x] + amid);
      |                                                        ^~~~
a.cc:137:31: error: expected primary-expression before 'long'
  137 |         long double ans = min(long double(got[sy][sx]), spt[sy][sx] + amin);
      |                               ^~~~
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

vector<vector<int>>fi;

vector<vector<int>>spt, got;

struct aa {
	int y;
	int x;
	int time;
};
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,1,0,-1 };


class Compare {
public:
	//keiroが昇順に並ぶ
	bool operator()(const aa&l, const aa&r) {
		return l.time>r.time;
	}
};

int main() {
	int W, H; cin >> W >> H;
	int sx, sy;
	pair<int, int>gp;
	vector<pair<int, int>>sps;
	fi.resize(H);
	spt.resize(H);
	got.resize(H);
	for (int i = 0; i < H; ++i) {
		
		string st; cin >> st;
		for (int j = 0; j < W; ++j) {
			spt[i].emplace_back(999999);
			got[i].emplace_back(999999);
			int wh;
			if (st[j] == '.') {
				wh = 0;
			}
			else if (st[j] == '#') {
				wh = 1;
			}
			else if (st[j] == '*') {
				wh = 2;
				sps.push_back(make_pair(i, j));
			}
			else if (st[j] == 's') {
				wh = 0;
				sx = j; sy = i;
			}
			else if (st[j] == 'g') {
				wh = 4;
				gp.first = i;
				gp.second = j;
			}
			else {
				assert(false);
			}
			fi[i].push_back(wh);
		}
	}
	{
		priority_queue<aa, vector<aa>, Compare>que;
		for (int i = 0; i < sps.size(); ++i) {
			que.push(aa{ sps[i].first, sps[i].second, 0 });
			spt[sps[i].first][ sps[i].second] = 0;
		}

		while (!que.empty()) {
			aa atop(que.top());
			que.pop();
			for (int i = 0; i < 4; ++i) {
				const int nx = atop.x + dx[i];
				const int ny = atop.y + dy[i];
				const int nt = atop.time + 1;
				if (!fi[ny][nx]) {
					if (spt[ny][nx] > nt) {
						spt[ny][nx] = nt;
						que.push(aa{ ny,nx,nt });
					}
				}
			}

		}
	}
	{
		priority_queue<aa, vector<aa>, Compare>que;
		que.push(aa{ gp.first, gp.second, 0 });
		got[gp.first][gp.second] = 0;
		

		while (!que.empty()) {
			aa atop(que.top());
			que.pop();
			for (int i = 0; i < 4; ++i) {
				const int nx = atop.x + dx[i];
				const int ny = atop.y + dy[i];
				const int nt = atop.time + 1;
				if (!fi[ny][nx]) {
					if (got[ny][nx] > nt) {
						got[ny][nx] = nt;
						que.push(aa{ ny,nx,nt });
					}
				}
			}

		}
	}

	long double amin = 0;
	long double amax = 1000000000;
	while (amin + 1e-11 < amax) {
		long double amid = (amin + amax) / 2;

		long double timesum = 0;
		long double placesum = 0;
		for (int y = 0; y < H; ++y) {
			for (int x = 0; x < W; ++x) {
				if (!fi[y][x]) {
					placesum++;
					timesum += min(static_cast<long double>(got[y][x]), spt[y][x] + amid);
				}
			}
		}
		if (amid < timesum / placesum) {
			amin = amid;
		}
		else {
			amax = amid;
		}
	}
	long double ans = min(long double(got[sy][sx]), spt[sy][sx] + amin);
	cout <<fixed<<setprecision(22)<< ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:137:31: error: expected primary-expression before 'long'
  137 |         long double ans = min(long double(got[sy][sx]), spt[sy][sx] + amin);
      |                               ^~~~
Language: C

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

using namespace std;

int n;
long long ans;

int main()
{
    //freopen("1", "r", stdin);
    while (~scanf("%d", &n))
    {
        ans = 0;
        while (n--)
        {
            long long a, b;
            char ch;
            scanf("%lld %c %lld", &a, &ch, &b);
            if (ch == ')')
            {
                ans += b;
            }
            else
            {
                ans -= b;
            }
            if (ans) printf("No\n");
            else printf("Yes\n");
        }
    }
    return 0;
}

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

#include<iostream>

using namespace std;

int main()
{
  int n;
  cin >> n;
 long lon cnt = 0;
  for(int i=0;i<n;i++)
    {
      int a,b; char c;
      cin >> a >> c >> b;
      c == '('?cnt += b:cnt -= b;
      !cnt?cout << "Yes" << endl:cout << "No" << endl;
    }
 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected initializer before 'cnt'
    9 |  long lon cnt = 0;
      |           ^~~
a.cc:14:16: error: 'cnt' was not declared in this scope; did you mean 'int'?
   14 |       c == '('?cnt += b:cnt -= b;
      |                ^~~
      |                int
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <assert.h>        //assert螳?#include <sstream>
#define PI 3.1415926535898
#define MAXN 10+1000

using namespace std;

int i,j,k;

int comp ( const void *a, const void *b )
{
    return * ( int * ) a - * ( int * ) b;   //莉主ー丞芦螟ァ謗貞コ?    //return *(int *)b-*(int *)a;           //莉主、ァ蛻ー蟆乗賜蠎?}
//qsort(a,sizeof(a),sizeof(int),comp);
//memset(a,0,MAXN);

int greatest_common_divisor(int x,int y)    //豎Ｙ蜥軽逧?怙螟ァ蜈ャ郤ヲ謨ー
{
    int t;
    if(x>y)
    {
        t=x;
        x=y;
        y=t;
    }
    while(y%x)
    {
        t=y%x;
        y=x;
        x=t;
    }
    return x;
}
int main()
{
    //freopen("in.txt","r",stdin);

int T;
int p,n;
char c;
int sum;
   while(scanf("%d",&T)!=EOF)
   {
       sum=0;
       while(T--)
       {
           scanf("%d %c %d",&p,&c,&n);
           if(c=='(')
                sum-=n;
           else
            sum+=n;
       // printf("p=%d\nc=%d\nn=%d\n",p,c,n);
        if(sum==0)
        printf("Yes\n");
       else
        printf("No\n");
       }

   }
    return 0;
}

Compiler output:
a.cc: In function 'int comp(const void*, const void*)':
a.cc:21:1: error: a function-definition is not allowed here before '{' token
   21 | {
      | ^
a.cc:37:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   37 | int main()
      |         ^~
a.cc:37:9: note: remove parentheses to default-initialize a variable
   37 | int main()
      |         ^~
      |         --
a.cc:37:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:38:1: error: a function-definition is not allowed here before '{' token
   38 | {
      | ^
a.cc:64:2: error: expected '}' at end of input
   64 | }
      |  ^
a.cc:15:1: note: to match this '{'
   15 | {
      | ^
Language: C++

#include<utility>    //pair
#include<vector>
#include<stdio.h>
#include<math.h>
#include<string>
#include<iostream>
#include<algorithm> //find逧?、エ譁?サカ  string逕ィfind逧?慮蛟吩シ夊ソ泌屓蟄礼ャヲ荳イ逧?ヲ門慍蝮?#include<iterator>
#include<string.h>
#include<deque>   //蜿悟髄豺サ蜉?焚蟄礼噪謨ー扈? 蜿ッ莉・蛻?勁謌冶?豺サ蜉?ャャ荳?クェ
#include<queue>
#include<set>      //諤サ隗牙セ玲イ。譛我サ?ケ育畑螟? 譌??螟咲噪
#include<list>    //荳肴髪謖?囂譛コ隶ソ髣ョ  蜊ウ郛コ蟆台ク区?
#include<map>       //謨ー謐ョ邀サ蝙句セ域婿萓ソ 菴?弍莨夊?蟾ア謗貞・ス蠎? 閠御ク比ク堺シ壽怏驥榊、咲噪蜈?エ?using namespace std;
int main()
{
    char z;
    int n,a,b,ans1,ans2;
    char c,d;
    while(cin>>n)
    {
        ans1=0;
        ans2=0;
        while(n--)
        {
           cin>>a>>c>>b;
            if(c=='(')
                ans1+=b;
            else
                ans2+=b;
            if(ans1==ans2)
                cout<<"Yes"<<endl;
            else
                cout<<"No"<<endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   19 |     while(cin>>n)
      |           ^~~
      |           std::cin
In file included from a.cc:6:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:31:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |                 cout<<"Yes"<<endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:31:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   31 |                 cout<<"Yes"<<endl;
      |                              ^~~~
      |                              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:33:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   33 |                 cout<<"No"<<endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:33:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   33 |                 cout<<"No"<<endl;
      |                             ^~~~
      |                             std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<stdio.h>
#include<algorithm>
#include<queue>
using namespace std;
char str[110][110];
int dx[]={1,0,0,-1};
int dy[]={0,1,-1,0};
int bfs[110][110][11][11][4];
struct wolf{
	int r,c,a,b,d;
	wolf(){}
	wolf(int R,int C,int A,int B,int D){r=R;c=C;a=A;b=B;d=D;}
};
int main(){
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	for(int i=0;i<a;i++)scanf("%s",str[i]);
	int sr,sc,gr,gc;
	for(int i=0;i<a;i++)for(int j=0;j<b;j++){
		if(str[i][j]=='S'){sr=i;sc=j;}
		if(str[i][j]=='G'){gr=i;gc=j;}
	}
	queue<wolf>Q;
	//for(int i=0;i<4;i++){
		bfs[sr][sc][0][0][0]=1;
		Q.push(wolf(sr,sc,0,0,0));
	//}
	while(Q.size()){
		wolf at=Q.front();
		Q.pop();
		int tr=at.r+dx[at.d];
		int tc=at.c+dy[at.d];
		if(tr<0||tc<0||tr>=a||tc>=b||str[tr][tc]=='#')continue;
		if(!bfs[tr][tc][at.a][at.b][at.d]){
			bfs[tr][tc][at.a][at.b][at.d]=1;
			Q.push(wolf(tr,tc,at.a,at.b,at.d));
		}
		if((tr!=sr||tc!=sc)&&at.a<c&&!bfs[tr][tc][at.a+1][at.b][td]){
			int td=at.d^1;
			bfs[tr][tc][at.a+1][at.b][td]=1;
			Q.push(wolf(tr,tc,at.a+1,at.b,td));
		}
		if((tr!=sr||tc!=sc)&&at.b<c&&!bfs[tr][tc][at.a][at.b+1][td]){
			int td=at.d^2;
			bfs[tr][tc][at.a][at.b+1][td]=1;
			Q.push(wolf(tr,tc,at.a,at.b+1,td));
		}
	}
	int ret=999999;
	for(int i=0;i<=c;i++)for(int j=0;j<=c;j++)for(int k=0;k<4;k++)
		if(bfs[gr][gc][i][j][k])ret=min(ret,i+j);
	if(ret<9999)printf("%d\n",ret);
	else printf("-1\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:73: error: 'td' was not declared in this scope; did you mean 'tc'?
   38 |                 if((tr!=sr||tc!=sc)&&at.a<c&&!bfs[tr][tc][at.a+1][at.b][td]){
      |                                                                         ^~
      |                                                                         tc
a.cc:39:29: error: redeclaration of 'int td'
   39 |                         int td=at.d^1;
      |                             ^~
a.cc:38:73: note: '<typeprefixerror>td' previously declared here
   38 |                 if((tr!=sr||tc!=sc)&&at.a<c&&!bfs[tr][tc][at.a+1][at.b][td]){
      |                                                                         ^~
a.cc:43:73: error: 'td' was not declared in this scope; did you mean 'tc'?
   43 |                 if((tr!=sr||tc!=sc)&&at.b<c&&!bfs[tr][tc][at.a][at.b+1][td]){
      |                                                                         ^~
      |                                                                         tc
a.cc:44:29: error: redeclaration of 'int td'
   44 |                         int td=at.d^2;
      |                             ^~
a.cc:43:73: note: '<typeprefixerror>td' previously declared here
   43 |                 if((tr!=sr||tc!=sc)&&at.b<c&&!bfs[tr][tc][at.a][at.b+1][td]){
      |                                                                         ^~
Language: C++

#include<queue>
#include<cstdio>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

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

struct stat{
	int y,x,dir,n1,n2; // n1, n2 : 鏡 /, \ の残り枚数
};

int main(){
	int h,w,n; scanf("%d%d%d",&h,&w,&n);
	char B[100][101];
	rep(i,h) scanf("%s",B[i]);

	int sx,sy;
	rep(i,h) rep(j,w) if(B[i][j]=='S') sx=j, sy=i;

	static int dp[100][100][4][11][11];
	memset(dp,-1,sizeof dp);
	dp[sy][sx][3][n][n]=0;
	rep(n1,n+1) rep(n2,n+1) dp[sy][sx][1][n1][n2]=777;

	int ans=-1;
	queue<stat> Q;
	Q.push((stat){sy,sx,3,n,n});
	while(!Q.empty()){
		int y=Q.front().y,x=Q.front().x,dir=Q.front().dir,n1=Q.front().n1,n2=Q.front().n2;
		Q.pop();

		if(B[y][x]=='G'){ ans=dp[y][x][dir][n1][n2]; break; }

		int y2=y+dy[dir],x2=x+dx[dir],dir2;
		if(y2<0 || h<=y2 || x2<0 || w<=x2 || B[y2][x2]=='#') continue;

		// 鏡を置かない
		dir2=dir;
		if(dp[y2][x2][dir2][n1][n2]==-1){
			dp[y2][x2][dir2][n1][n2]=dp[y][x][dir][n1][n2];
			Q.push((stat){y2,x2,dir2,n1,n2});
		}

		// 鏡 / を置く
		dir2=dir^1;
		if(n1>0 && dp[y2][x2][dir2][n1-1][n2]==-1){
			dp[y2][x2][dir2][n1-1][n2]=dp[y][x][dir][n1][n2]+1;
			Q.push((stat){y2,x2,dir2,n1-1,n2});
		}

		// 鏡 \ を置く
		dir2=3-dir;
		if(n2>0 && dp[y2][x2][dir2][n1][n2-1]==-1){
			dp[y2][x2][dir2][n1][n2-1]=dp[y][x][dir][n1][n2]+1;
			Q.push((stat){y2,x2,dir2,n1,n2-1});
		}
	}

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

	return 0;
}

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

#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <iterator>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
 
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) container.begin(), container.end()
#define RALL(container) container.rbegin(), container.rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
 
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
 
const int INF = 1<<28;
const double EPS = 1e-8;
const int MOD = 1000000007;
 
 
int n;
 
vector<vi> g;
int c[500005], lev[500005], memo[500005];
ll naive[500005];
void dfs(int r, int level = 0){
	lev[r] = level;
	FOR(v, g[r]){
		dfs(*v, level+1);
		c[r] += c[*v];
		naive[r] += naive[*v] + c[*v];
	}
}
 
ll solve(int r){
	if(r == n-1) return 0;
	if(memo[r]) return memo[r];
	ll res = 0;
	int d = lev[r];
	int c1 = g[r][0];
	int c2 = g[r][1];
	return memo[r] = min(naive[c1]+c[c1]+solve(c2)+1,
					 min(naive[c2]+c[c2]+solve(c1)+1,
						 solve(c1)+solve(c2)+d+2));
}
 
_main(){
	ios::sync_with_stdio(false);
	while(cin >> n){
		g = vector<vi>(n);
		REP(i, n-1){
			int x, y;
			cin >> x >> y;x--;y--;
			g[i].push_back(x);
			g[i].push_back(y);
		}
		memset(c, 0, sizeof(c));
		c[n-1] = 1;
		naive[n-1] = 0;
		dfs(0);
		cout << solve(0) << endl;
	}
	return 0;
}

long long esp_org, esp_new;

main(){
    //  新しいスタック領域を確保する
    const int size = 32*1024*1024;
    void *p = malloc(size);
    esp_new = (long long)p + size - 1;

    //  スタックを置き換える
    __asm__("mov %rsp, esp_org");
    __asm__("mov esp_new, %rsp");
    
    //  メインの処理
    _main();
    //  スタックを元に戻す
   __asm__("mov esp_org, %rsp");

    return 0;
}

Compiler output:
a.cc:82:1: error: ISO C++ forbids declaration of '_main' with no type [-fpermissive]
   82 | _main(){
      | ^~~~~
a.cc:103:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  103 | main(){
      | ^~~~
Language: C++

#include<cstdio>
#include<iostream>

#define REP(i,s,n) for(register int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define MAX 500010

using namespace std;

long long depth[MAX],L[MAX],R[MAX],N,noSaveDp[MAX],saveDp[MAX],leaf[MAX];

int main(){
  scanf("%d",&N);
  depth[0] = leaf[N-1] = 1;
  rep(i,N-1){
    scanf("%d %d",&L[i],&R[i]);
    depth[--L[i]] = depth[--R[i]] = depth[i] + 1;
  }

  for(i = N-2;i>=0;i--){
    leaf[i] = leaf[L[i]] + leaf[R[i]];
    saveDp[i] = noSaveDp[i] = noSaveDp[L[i]] + noSaveDp[R[i]] + leaf[L[i]] + leaf[R[i]];
    saveDp[i] = min(saveDp[i],
		    min(noSaveDp[L[i]]+leaf[L[i]]+1+saveDp[R[i]],
			noSaveDp[R[i]]+leaf[R[i]]+1+saveDp[L[i]]));
    saveDp[i] = min(saveDp[i],
		    saveDp[L[i]]+1+depth[i]-1+1+saveDp[R[i]]);
  }
  printf("%d\n",saveDp[0]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   15 |   rep(i,N-1){
      |       ^
a.cc:4:37: note: in definition of macro 'REP'
    4 | #define REP(i,s,n) for(register int i=s;i<n;i++)
      |                                     ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(i,N-1){
      |   ^~~
a.cc:20:7: error: 'i' was not declared in this scope
   20 |   for(i = N-2;i>=0;i--){
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int V,E;
double P,Q;
vector<int> G[15];
 
 
void printbit(int S){
  for(int i=0;i<V;i++){
    cout<<(S>>i&1)<<' ';
  }
  cout<<endl;
}
 
double func(int S,int U){
 
  double res=1;
  for(int i=0;i<V;i++){
    if(S>>i&1){
      for(int j=0;j<(int)G[i].size();j++){
        int w=G[i][j];
        if(S>>w&1)continue;
        if(U>>w&1)        res*=P;
      }
    }
  }
 
 
 
  return res;
}
 
double dp[(1<<14)];
 
double rec(int S){
 
  if(dp[S]!=-1)return dp[S];
  if(S==1)return 1.0;
 
  double res=0;
  int sup=S;
  int sub=sup;
  
 
  do{
    if(sub&1){
      if(sub!=S){
        double A=rec(sub);
        double B=func(sub,S);
        res+=A*B;
      }
    }
    sub=(sub-1)⊃
  }while(sub!=sup);
 
  res=1.0-res;
 
  return dp[S]=res;
}
 
void init(){
  for(int i=0;i<15;i++)G[i].clear();
  for(int i=0;i<(1<<14);i++){
    dp[i]=-1;
  }
}
 
 
bool check(){
  bool visited[15]={};
  visited[0]=true;
  queue<int> que;
  que.push(0);
 
  while(!que.empty()){
    int pos=que.front();que.pop();
    for(int i=0;i<(int)G[pos].size();i++){
      int w=G[pos][i];
      if(visited[w])continue;
      visited[w]=true;
      que.push(w);
    }
  }
 
  for(int i=0;i<V;i++)
    if(!visited[i])return false;
 
  return true;
}
 
int main(){
  while(cin>>V>>E>>P){
    init();
    P/=100.0;
    Q=1.0-P;
    for(int i=0;i<E;i++){
      int a,b;
      cin>>a>>b;
      a--;b--;
      G[a].push_back(b);
      G[b].push_back(a);
    }
 
    if(!check()){
      printf("0.0\n");
      continue;
    }
    printf("%.10f\n",rec((1<<V)-1));
  }
  return 0;
}

Compiler output:
a.cc:53:16: error: extended character ⊃ is not valid in an identifier
   53 |     sub=(sub-1)⊃
      |                ^
a.cc: In function 'double rec(int)':
a.cc:53:16: error: expected ';' before '\U00002283'
   53 |     sub=(sub-1)⊃
      |                ^
      |                ;
Language: C++

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

#include "dump.hpp"

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(10);

	int n, m;
	double p;
	cin >> n >> m >> p;
	p /= 100;

	vector<vector<int>> G(n);
	for(int i = 0; i < m; ++i) {
		int u, v;
		cin >> u >> v;
		--u; --v;
		G[u].emplace_back(v);
		G[v].emplace_back(u);
	}

	vector<double> dp(1 << n, 0.0);

	for(int bit = 0; bit < 1 << (n - 1); ++bit) {
		const int V = (bit << 1) | 1;

		double sum = 0.0;
		for(int S = V; S > 0; S = (S - 1) & V) {
			if(!(S & 1)) continue;

			const int T = V ^ S;
			double q = 1.0;
			for(int v = 0; v < n; ++v) {
				if(!(S >> v & 1)) continue;

				for(const auto &u : G[v]) {
					if(!(T >> u & 1)) continue;
					q *= p;
				}
			}
			sum += dp[S] * q;
		}
		dp[V] = 1.0 - sum;
	}

	dump(dp);

	cout << dp[(1 << n) - 1] << endl;

	return EXIT_SUCCESS;
}

Compiler output:
a.cc:6:10: fatal error: dump.hpp: No such file or directory
    6 | #include "dump.hpp"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
#define bit(x) (1<<(x))
using namespace std;

int n,m,p;
int a[15][15];

using R=long double;
R dp[1<<14];

int main(void){
	cin >> n >> m >> p;
	rep(i,m){
		int u,v;
		cin >> u >> v;
		a[u-1][v-1]++;
		a[v-1][u-1]++;
	}

	rep(mask,1,1<<n){
		dp[mask]=1.0;		
		if(__builtin_popcount(mask)==1) continue;
		for(int add=(mask-1)&mask;add>=limit;add=(add-1)&mask){
			int root=add^mask;
			if(add<root) break;
			double cur=dp[add];
			rep(i,n)rep(j,n) if(root&bit(i)) if(add&bit(j)) rep(loop,a[i][j]) cur*=1.0*p/100.0; 
			dp[mask]-=cur;	
		}
	}

	cout.precision(20);
	cout << fixed << dp[bit(n)-1] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:48: error: 'limit' was not declared in this scope
   27 |                 for(int add=(mask-1)&mask;add>=limit;add=(add-1)&mask){
      |                                                ^~~~~
Language: C++

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

using namespace std;

int V;                      //????????°
vector<int>G[10000];       //??°???)(){????????£??\????????¨???
vector<int>rG[10000];
vector<int> vs;             //??°?????????????????????
bool used[10000];           //?????§???????????????
int cmp[10000];             //?±????????????£????????????????????????????????????
int P;

void add_edge(int from, int to){
    G[from].push_back(to);
    rG[to].push_back(from);
}

void dfs(int v){
    used[v] = true;
    for(int i=0;i<G[v].size();i++){
        if(!used[G[v][i]]) dfs(G[v][i]);
    }
    vs.push_back(v);
}
int rdfs(int v,int k){
    used[v] = true;
    cmp[v] = k;
    int ret=0;
    for(int i=0;i<rG[v].size();i++){
        if(!used[rG[v][i]]) {
            ret+=rdfs(rG[v][i], k);
        }
    }
    return ret;
}

double scc(){
    memset(used, 0, sizeof(used));
    vs.clear();
    for(int v=0;v<V;v++){
        if(!used[v]) dfs(v);
    }
    memset(used,0,sizeof(used));
    int k=0;
    double ans=0;
    for(int i=vs.size()-1;i>=0;i--){
        if(!used[vs[i]]) {
            int nu=rdfs(vs[i], k++);
            if(nu>1){
                double du=(nu*(nu-1)*1.0)/2*P*P;
                ans+=du;
            } else {
                ans+=P;
            }
        }
    }
    return ans;
}

int N,M;
int A[50000], B[50000];

void solve(){
    cin>>N>>M>>P;
    V=N;
    for(int i=0;i<M;i++){
        cin>>A[i]>>B[i];
    }
    for(int i=0;i<M;i++){
        add_edge(A[i]-1,B[i]-1);
    }
    printf("%.9f\n",scc());
}
int main()
{
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'double scc()':
a.cc:49:5: error: 'memset' was not declared in this scope
   49 |     memset(used, 0, sizeof(used));
      |     ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include<stack>
  +++ |+#include <cstring>
   13 |
Language: C++

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


typedef complex<double> P; //Point
typedef pair<P,P> L; //Line, Segment

const double EPS = 1e-12;
const double PI = 6.0 * asin(0.5);

namespace std {
  bool operator < (const P& a, const P& b){
    return fabs(real(a)-real(b)) < EPS ? imag(a) < imag(b) : real(a) < real(b);
  }
  bool operator == (const P& a,const P& b){
    return fabs(real(a)-real(b)) < EPS && fabs(imag(a)-imag(b))<EPS;
  }
}

double dot(P a, P b){ return real(conj(a)*b); }
double cross(P a, P b){ return imag(conj(a)*b); }
// 線分と点の交差判定
bool isIntersectSP(L s, P p){ 
  return abs(s.first-p) + abs(s.second-p) - abs(s.second-s.first) < EPS; 
}

int N;
L seg[1001];
P tp,pp;
int startid;

P getPoint(double dis,int di){
  double r = 0.0;
  if( di == -1 ){
    r = abs(seg[startid].first-tp);
  } else {
    r = abs(seg[startid].second-tp);
  }

  if( dis < r + EPS ){
    P v;
    if( di == -1 ){
      v = seg[startid].first - tp;
      if( r < EPS ) return seg[startid].first;
    }
    else {
      v = seg[startid].second - tp;    
      if( r < EPS ) return seg[startid].second;
    }
    //  cout << "getPoint " << v << " " << tp << " "<< r << " " << dis << endl;
    return tp + v/abs(v)*dis;
  }

  for(int i=startid+di;0<=i && i<N-1;i+=di){
    double s = dis - r;
    r += abs(seg[i].first - seg[i].second);
    double kr =abs(seg[i].first - seg[i].second);
    if( dis < r + EPS ){
      P v;
      if( di == -1 ){
	v = seg[i].first - seg[i].second;
	return seg[i].second + v/kr*s;      
      }
      else {
	v = seg[i].second - seg[i].first;  
	return seg[i].first + v/kr*s;      
      }
    }
  }
  return P(-1e19,-1e19);
}

double solve(int bit,int tv,int pv,double now,P pnow){
  if( bit == 3 ) return now;
  double res = 1e20;
  for(int i=0;i<2;i++){
    if( bit & (1<<i) ) continue;

    double st = now, ed = 1000000000.0;
    P pnext=pnow;
    while( fabs(ed-st) > EPS ){
      double t = (st + ed)/2.0;
      int di = i==0?-1:1;
      double dis = (double)tv * t;
      P p = getPoint(dis,di);

      //  cout << t << " " << dis << " " <<pnow << " -> " << p << endl;

      if( p == P(-1e19,-1e19) ){
	ed = t;
      } else {
	double disp  = (double)pv * (t-now);
	double ky = abs(p - pnow);
	//	cout << "disp " << disp << " ky " << ky << endl;
	if( disp+EPS > ky ){
	  pnext = p;
	  ed = t;
	} else {
	  st = t;
	}
      }
    }
    //      cout << pnow << " -> " << pnext << endl;
    // cout << st << " " << now << endl;
    res = min( res,solve(bit|(1<<i),tv,pv,st,pnext) );
  }
  return res;
}

Compiler output:
/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