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

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	int N, M; cin >> N >> M;
	if (M == 0) {
		cout << 0 << endl;
		return 0;
	}
	vector<double> L(N), a(N), b(N);
	for (int i = 0; i < N; i++)
		cin >> L[i] >> a[i] >> b[i];
	vector< vector<double> > d(N, vector<double>(N));
	for (int i = 0; i < N; i++)
		for (int j = i + 1; j < N; j++) {
			double dL = L[i] - L[j], da = a[i] - a[j], db = b[i] - b[j];
			d[i][j] = dL * dL + da * da + db * db;
		}
	double maxi = 0;
	for (int S = (1 << M) - 1; S < (1 << N);) {
		double sum = 0;
		for (int i = 0; i < N; i++) {
			if (S & (1 << i))
				for (int j = i + 1; j < N; j++)
					if ((S & (1 << j)))
						sum += d[i][j];
		maxi = max(maxi, sum);
		int x = S & -S, y = S + x;
		S = ((S & ~y) / x >> 1) | y;
	}
	printf("%.10f\n", maxi);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:2: error: expected '}' at end of input
   61 | }
      |  ^
a.cc:33:12: note: to match this '{'
   33 | int main() {
      |            ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <utility>
#include <typeinfo>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#define REP(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;

int main() 
{
	int n,m;
	cin>>n>>m;
	double a[20][3]={};
	REP(i,n){cin>>a[i][0]>>a[i][1]>>a[i][2];}
	
	double b[20][20]={};
	REP(i,n){REP(j,n){b[i][j]+=(a[i][0]-a[j][0])*(a[i][0]-a[j][0])+(a[i][1]-a[j][1])*(a[i][1]-a[j][1])+(a[i][2]-a[j][2])*(a[i][2]-a[j][2]);}}
	
	int c[20]={};//i番目が選択済みなら1をたてる
	
	//m<2の時
	if(m<2){cout<<0<<endl;}
	else
	{
	//m=2の時
		double ans(0);
		for(int z=2;z<=m;z++)
		{
			//cout<<"z= "<<z<<endl;
			//	cout <<fixed << setprecision(7) <<"ans= "<<  ans <<endl;			
			if(z==2)
			{
				int x,y;
				REP(i,n){REP(j,n){if(ans<b[i][j]){ans=b[i][j];x=i,y=j;}}}
				c[x]=1;
				c[y]=1;//cout<<"x= "<<x<<endl<<"y= "<<y<<endl;
			}
			else
			{
				int p;
				double max(0);
				for(int i=0;i<n;i++)
				{
					double tmp(0);
					REP(j,n){tmp+=b[i][j]*c[j]*(1-c[i]);}
					//cout<<"i="<<i<<"の時、合計は"<<tmp<<endl;
					if(max<tmp){max=tmp;p=i;//cout<<"pを"<<p<<"に変換"<<endl;}
				}
				c[p]=1;
				ans+=max;//cout<<"p= "<<p<<endl;//REP(i,n)cout<<c[i];cout<<endl;
			}
		}
		cout <<fixed << setprecision(7) <<  ans <<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:2: error: expected '}' at end of input
   68 | }
      |  ^
a.cc:22:1: note: to match this '{'
   22 | {
      | ^
Language: C++

from itertools import combinations as comb
def cube_dist(a,b):
	return sum([(a[i]-b[i])**2 for i in range(3)])
def cal_total_dist(t):
	if len(t) == 1:
		return 0
	return sum([cube_dist(ca,cb) for ca, cb in comb(t,2)])

N, M = map(int,raw_input().split())
color = [tuple(map(float,raw_input().split())) for i in range(N)]
print max([cal_total_dist(ctuple) for ctuple in comb(color,M)])

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from itertools import combinations as comb
      | ^~~~
Language: C++

#include<iostream>I don't know
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
double ta[300][3];
bool used[300],tused[300];

	int n,m;
double ans=0;
double solve(int now){
double ret=0.0;
while(true){
	tused[now]=0;

	int next=0,f=0;
	for(int i=0;i<n;i++){
		if(tused[i]&&!f)next=i,f=1;
	}
	for(int i=0;i<n;i++){
	if(tused[i]){
		for(int j=0;j<3;j++)ret+=(ta[i][j]-ta[now][j])*(ta[i][j]-ta[now][j]);

		}
	}
	now=next;
	bool endf=1;
	for(int i=0;i<n;i++)if(tused[i])endf=0;
	if(endf)break;
}
return ret;
}
void  dfs(int h,int use){
	if(h==n){
	//for(int i=0;i<n;i++)cout<<used[i]<<" ";cout<<endl;
	if(use==m){
	int next=0;
	for(int i=n-1;i>=0;i--)if(used[i])next=i,tused[i]=used[i];
	ans=max(ans,solve(next));
	}
	return ;
	}
	used[h]=1;
	dfs(h+1,use+1);
	used[h]=0;
	dfs(h+1,use);
}
int main(){

	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)cin>>ta[i][0]>>ta[i][1]>>ta[i][2];
	dfs(0,0);
	printf("%.10f\n",ans);
	return 0;
}2300

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include<iostream>I don't know
      |                     ^~~
a.cc:1:24: warning: missing terminating ' character
    1 | #include<iostream>I don't know
      |                        ^
a.cc:1:9: fatal error: iostream>: No such file or directory
    1 | #include<iostream>I don't know
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#define r(i,a,n) for(int i=a;i<n;i++)
double a[21][3],ans=0,p;int n,m,c[21];
using namespace std;
double cal(){p=0;
  r(i,0,m)r(j,i+1,m)
  p+=pow(a[c[i]][0]-a[c[j]][0],2)+pow(a[c[i]][1]-a[c[j]][1],2)+pow(a[c[i]][2]-a[c[j]][2],2);
  ans=max(ans,p);
}
void dfs(int x,int d){
  if(d==m){cal();return;}
  else if(x==n)return;
  c[d]=x;dfs(x+1,d+1);dfs(x+1,d);
}
int main(){
  cin>>n>>m
    r(i,0,n)cin>>a[i][0]>>a[i][1]>>a[i][2];
    dfs(0,0);
    printf("%.12d\n",ans);
  
}

Compiler output:
a.cc: In function 'double cal()':
a.cc:9:1: warning: no return statement in function returning non-void [-Wreturn-type]
    9 | }
      | ^
a.cc: In function 'int main()':
a.cc:16:12: error: expected ';' before 'for'
   16 |   cin>>n>>m
      |            ^
      |            ;
a.cc:17:7: error: 'i' was not declared in this scope
   17 |     r(i,0,n)cin>>a[i][0]>>a[i][1]>>a[i][2];
      |       ^
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,a,n) for(int i=a;i<n;i++)
      |                              ^
Language: C++

#include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
int n,m;
double a[20][3],d[20][20];
int main(){
	cin>>n>>m;
	for(int i=0;i<n;i++){
		for(int j=0;j<3;j++)cin>>a[i][j];
		for(int j=0;j<i;j++){
			double cnt=0.0;
			for(int k=0;k<3;k++)cnt+=(a[i][k]-a[j][k])*(a[i][k]-a[j][k]);
			d[i][j]=cnt,d[j][i]=cnt;
		}
	}
	bool b[20];memset(b,0,n);
	double ans=0.0;
	for(int i=0;i<(1<<n);i++){
		int cnt=0;
		for(int j=0;j<n;j++)if(b[j])cnt++;
		if(cnt==m){
			double ret=0.0;
			for(int j=0;j<n;j++){
				for(int k=0;k<j;k++){
					if(b[j]&&b[k])ret+=d[j][k];
				}
			}
			ans=max(ans,ret);
		}
		for(int j=0;j<n;j++){
			if(i%(1<<j)==(1<<j)-1)b[j]=1-b[j];
		}
	}
	cout<<fixed<<setprecision(10)<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'memset' was not declared in this scope
   17 |         bool b[20];memset(b,0,n);
      |                    ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<iomanip>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

Z:~/contest$ ./a.out
3 3 5
...
.##
..#
1 1 1
1 0 0
1 1 0
3 3 3
3 0 0
3 3 0
5 4 5
4 0 0
5 4 0
1 0
2 1
0 2
2 0
0 0
x y is 2 1 Time is 1
res is 3
x y is 3 1 Time is 2
res is 6
x y is 3 2 Time is 3
res is 9
x y is 3 1 Time is 4
res is 11
x y is 2 1 Time is 5
res is 15
x y is 1 1 Time is 6
res is 18
x y is 1 2 Time is 7
res is 21
x y is 2 1 Time is 1
res is 17
x y is 3 1 Time is 2
res is 15
x y is 1 3 Time is 8
res is 18
x y is 1 2 Time is 9
res is 20
x y is 1 1 Time is 10
res is 24
x y is 2 1 Time is 11
res is 31
x y is 3 2 Time is 3
res is 31
x y is 3 1 Time is 4
res is 33
x y is 2 1 Time is 5
res is 27
x y is 1 1 Time is 6
res is 23
x y is 1 2 Time is 7
res is 21
x y is 2 1 Time is 1
res is 17
x y is 3 1 Time is 2
res is 15
x y is 3 1 Time is 12
res is 23
x y is 2 1 Time is 13
res is 30
x y is 1 3 Time is 8
res is 30
x y is 1 2 Time is 9
res is 32
x y is 1 1 Time is 10
res is 36
x y is 2 1 Time is 11
res is 34
x y is 3 2 Time is 3
res is 34
x y is 3 1 Time is 4
res is 26
x y is 2 1 Time is 5
res is 20
x y is 1 1 Time is 6
res is 16
x y is 1 2 Time is 7
res is 14
x y is 2 1 Time is 1
res is 10
x y is 3 1 Time is 2
res is 8
x y is 1 1 Time is 14
res is 16
43

Compiler output:
a.cc:4:2: error: stray '##' in program
    4 | .##
      |  ^~
a.cc:5:3: error: stray '#' in program
    5 | ..#
      |   ^
a.cc:1:1: error: 'Z' does not name a type
    1 | Z:~/contest$ ./a.out
      | ^
Language: C++

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

using namespace std;
typedef double db;
const db PI = acos(-1.0);
const db G = 9.8;
struct box{
    db s,t;
    box(){}box(db s,db t):s(s),t(t){}
    bool operator <(const box &i)const{
        return s < i.s;
    }
};
const int MaxN = 128;
box seg[MaxN*8],rS[MaxN*8];
int sn,V;
db X1(db y,db theta){
    db a = V*sin(theta);
    return (a-sqrt(a*a-2*G*y)) / G*V*cos(theta);
}
db X2(db y,db theta){
    db a = V*sin(theta);
    return (a+sqrt(a*a-2*G*y)) / G*V*cos(theta);
}
db bioSearch(db s,db t,db x,db (*fx)(db , db )){
    for (int i = 0;i < 100;i++){
        db d = (s+t)*0.5;
        db cx = fx(x,d);
        if (cx-x < 1e-9) s = d;
        else t = d;
    }
    return s;
}
void makeY(int y,int x1,int x2){
    db s1 = bioSearch(0,PI*0.5,x1,X1);
    db t1 = bioSearch(0,PI*0.5,x1,X2);
    db s2 = bioSearch(0,PI*0.5,x2,X1);
    db t2 = bioSearch(0,PI*0.5,x2,X2);
    seg[sn++] = box(s1,t1);
    seg[sn++] = box(s2,t2);
}
void makeX(int x,int y1,int y2){
    db b = atan2(x,)
}
bool findPlace(db gs,db gt,box S[],int n){
    bool fail = true;
    for (int i = 0;i < n;i++){
        db cs = max(gs,S[i].s);
        db ct = min(gt,S[i].t);
        if (cs < ct-1e-9) return true;
    }
    return false;
}
int L[MaxN],B[MaxN],R[MaxN],T[MaxN];
int main(){
    for (int N,X,Y;scanf("%d%d%d%d",&N,&V,&X,&Y) != EOF;){
        for (int i = 0;i < N;i++)
            scanf("%d%d%d%d",&L[i],&B[i],&R[i],&T[i]);
        sn = 0;
        for (int i = 0;i < N;i++){
            makeY(B[i],L[i],R[i]);
            makeY(T[i],L[i],R[i]);
            makeX(L[i],B[i],T[i]);
        }
        sort(seg,seg+sn);
        db px = 0.0;
        int rn = 0;
        for (int i = 0;i < sn;){
            db cx = seg[i].s;
            if (cx-px > 1e-9)
                rS[rn++] = box(px,cx);
            px = max(px,seg[i].t);
        }
        if (px < PI*0.5)
            rS[rn++] = box(px,PI*0.5);
        db fs,ft,gs,gt;
        if (findPlace(fs,ft,rS,rn) ||
            findPlace(gs,gt,rS,rn))
            puts("Yes");
        else
            puts("No");
    }
    return 0;
}

Compiler output:
a.cc: In function 'void makeX(int, int, int)':
a.cc:46:20: error: expected primary-expression before ')' token
   46 |     db b = atan2(x,)
      |                    ^
Language: C++

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

#define INF 0x7fffffff
#define MOD 10000007
#define N 30

using namespace std;

typedef long long LL;
typedef __int64 INT;

struct node
{
      double a,b,c;
} color[N];
int ans[N];
int n,m;
double Min;

/*f[n][k][0]=min
              {
                    f[n-1][k][1]
                    f[n-1][k][0];
              }
f[n][k][1]=min
              {
                    f[n-1][k-1][1];
                    f[n-1][k-1][0];
              }

*/
double squr(double a,double b,double c)
{
      return a*a+b*b+c*c;
}
void dfs(int now,int tot)
{
      if(tot==m)
      {
            double cnt=0.0;
            for(int i=1;i<=m;i++)
            {
                  for(int j=i+1;j<=m;j++)
                  {
                        double aa=color[ans[i]].a-color[ans[j]].a;
                        double bb=color[ans[i]].b-color[ans[j]].b;
                        double cc=color[ans[i]].c-color[ans[j]].c;
                        cnt=cnt+squr(aa,bb,cc);
                  }
            }
            if(cnt>Min) Min=cnt;
            return;
      }
      if(tot>n-now+1) return;
      for(int i=now;i<=n;i++)
      {
            ans[tot+1]=i;
            dfs(i+1,tot+1);
      }
}
int main()
{
      scanf("%d%d",&n,&m);
      for(int i=1;i<=n;i++)
            scanf("%lf%lf%lf",&color[i].a,&color[i].b,&color[i].c);
      memset(ans,0,sizeof(ans));
      Min=-INF;
      dfs(1,0);
      printf("%.20lf\n",Min);
      return 0;
}

Compiler output:
a.cc:14:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   14 | typedef __int64 INT;
      |         ^~~~~~~
      |         __int64_t
Language: C++

/*豕ィ諢乗イ。譛牙?蟋句喧*/
#include<stdio.h>
#include<iostream>
#include<memory.h>
#include<math.h>
using namespace std;
const int maxn=30;
double dis[maxn][maxn];
typedef struct
{
	double x,y,z;
}node;
node p[maxn];
bool flag[maxn];
int subset[maxn];
int mark=0;
int main()
{
	int N,M;
	scanf("%d %d",&N,&M);
	if(M==1)
	{
		printf("%.20lf\n",0);
		return;
	}
	for(int i=1;i!=N+1;++i)
		scanf("%lf %lf %lf",&p[i].x,&p[i].y,&p[i].z);
	//豎りキ晉ヲサ荵句柱
	int xx=0,yy=0,maxd=0;
	for(int i=1;i!=N+1;++i)
		for(int j=1;j!=i+1;++j)
		{
			double tempx=p[i].x-p[j].x;
			double tempy=p[i].y-p[j].y;
			double tempz=p[i].z-p[j].z;
			dis[i][j]=dis[j][i]=tempz*tempz+tempy*tempy+tempx*tempx;
			if(dis[i][j]>maxd)
			{
				maxd=dis[i][j];
				xx=i;
				yy=j;
			}
		}
    //螟?炊譛?シ?ァ狗噪荳、荳ェ轤ケ
	double ans=maxd;
	flag[xx]=1;flag[yy]=1;
	subset[mark++]=xx;
	subset[mark++]=yy;
	while(mark!=M)
	{
		double m=0;
		int k=0;
		for(int i=1;i!=N+1;++i)
		{
			if(flag[i]) continue;
			double temp=0;
			for(int j=0;j!=mark;++j)
				temp+=dis[i][subset[j]];
			if(m<temp)
			{
				m=temp;
				k=i;
			}
		}
		flag[k]=1;
		subset[mark++]=k;
		ans+=m;
	}
	printf("%.20lf\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   24 |                 return;
      |                 ^~~~~~
Language: C++

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;

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

int main() {
	int n, m;
	scanf("%d %d", &n, &m);

	vector<double> l(n), a(n), b(n);
	for(int i = 0; i < n; ++i)
		scanf("%lf %lf %lf", &l[i], &a[i], &b[i]);

	vector<vector<double> > dist(n, vector<double>(n));
	for(int i = 0; i < n; ++i) {
		for(int j = 0; j < n; ++j) {
			const double dl = l[i] - l[j], da = a[i] - a[j], db = b[i] - b[j];
			dist[i][j] = dl * dl + da * da + db * db;
		}
	}

	double ans = 0.0;
	for(int i = 0; i < (1 << n); ++i) {
		if(__builtin_popcount(i) != m)
			continue;

		double tmp = 0.0;
		for(int j = 0; j < n; ++j)
			if(i & (1 << j)) {
				for(int k = j + 1; k < n; ++k)
					if(i & (1 << k))
						tmp += dist[j][k];


		chmax(ans, tmp);
	}

	printf("%.20lf\n", ans);

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:2: error: expected '}' at end of input
   44 | }
      |  ^
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
Language: C++

#include <cstdio>
#include <cmath>

double P, E, T;

double dfs(int K, double L, double R) {
  double H = 0.5*(L+R);
  if (K == 0) return (std::abs(T-H) < E)? 1.0:0.0;

  double LH = dfs(K-1, L, H, P, E, T);
  double HR = dfs(K-1, H, R, P, E, T);
  if (H >= T) {
    return P * HR + (1.0-P) * LH;
  } else {
    return P * LH + (1.0-P) * HR;
  }
}

int main() {
  int K;
  double L, R;
  scanf("%d %lf %lf", &K, &L, &R);
  scanf("%lf %lf %lf", &P, &E, &T);

  printf("%.12f\n", dfs(K, L, R, P, E, T));
}



Compiler output:
a.cc: In function 'double dfs(int, double, double)':
a.cc:10:18: error: too many arguments to function 'double dfs(int, double, double)'
   10 |   double LH = dfs(K-1, L, H, P, E, T);
      |               ~~~^~~~~~~~~~~~~~~~~~~~
a.cc:6:8: note: declared here
    6 | double dfs(int K, double L, double R) {
      |        ^~~
a.cc:11:18: error: too many arguments to function 'double dfs(int, double, double)'
   11 |   double HR = dfs(K-1, H, R, P, E, T);
      |               ~~~^~~~~~~~~~~~~~~~~~~~
a.cc:6:8: note: declared here
    6 | double dfs(int K, double L, double R) {
      |        ^~~
a.cc: In function 'int main()':
a.cc:25:24: error: too many arguments to function 'double dfs(int, double, double)'
   25 |   printf("%.12f\n", dfs(K, L, R, P, E, T));
      |                     ~~~^~~~~~~~~~~~~~~~~~
a.cc:6:8: note: declared here
    6 | double dfs(int K, double L, double R) {
      |        ^~~
Language: C++

#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#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)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

struct UnionFind {
	vector<int> v;
	UnionFind(int n) : v(n) { for (int i = 0; i < n; i++) v[i] = i; }
	int  find(int x) { return v[x] == x ? x : v[x] = find(v[x]); }
	void unite(int x, int y) { v[find(x)] = find(y); }
};

int main() {
	int night;
	double r, l, p, e, t;
	cin >> night >> r >> l >> p >> e >> t;
	double ans = 0.0;
	queue<pair<pair<double,double>, double>> Q;
	Q.push({ {l,r},1.0 });
	REP(i, night) {
		pair<pair<double, double>, double> q = Q.front();Q.pop();
		if ((q.first.first+ q.first.second) / 2 >= t) {
			Q.push({ { (q.first.first+q.first.second)/2.0,q.first.second },q.second*(1.0-p) });
			Q.push({ { q.first.first,(q.first.first + q.first.second) / 2.0 },q.second*p });
		}
		else {
			Q.push({ { (q.first.first + q.first.second) / 2.0,q.first.second },q.second*p });
			Q.push({ { q.first.first,(q.first.first + q.first.second) / 2.0 },q.second*(1.0 - p) });
		}
	}
	while (!Q.empty()) {
		pair<pair<double, double>, double> q = Q.front();Q.pop();
		if (abs((q.first.first + q.first.second) / 2-t)-t <=e+1e-10) {
			ans += q.second;
	}
	printf("%.6lf\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:77:2: error: expected '}' at end of input
   77 | }
      |  ^
a.cc:53:12: note: to match this '{'
   53 | int main() {
      |            ^
Language: C++

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

double amax,amin,pp=0,p,t,k;

void ppsum(vector<bool> v){
    double tmp=1;
    for(int i=0;i<v.size();i++){
        if(v[i])tmp*=(1-p);
        else tmp*=p;
    }
    pp+=tmp;
}

void night(double r,double l,vector<bool> v){
    double h=(l+r)/2;
    if(v.size()==k||v.size>21){
        if(h>=amin&&h<=amax){
            ppsum(v);
        }
        return;
    }
    if(l<amin||r>amax)return;
    else{
        v.push_back(true);
        (h>=t)?night(r,h,v):night(h,l,v);
        v[v.size()-1]=false;
        (h>=t)?night(h,l,v):night(r,h,v);
    }
}

void solve(int _k,int r,int l,double _p,double e,double _t){
    p=_p;
    k=_k;
    t=_t;
    amin=t-e;
    amax=t+e;
    vector<bool> v;
    night((double)r,(double)l,v);
    cout<<pp<<endl;
    
}

int main (){
    int a,b,c;
    double d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
    solve(a,b,c,d,e,f);
}

Compiler output:
a.cc: In function 'void night(double, double, std::vector<bool>)':
a.cc:17:23: error: invalid use of member function 'std::vector<bool, _Alloc>::size_type std::vector<bool, _Alloc>::size() const [with _Alloc = std::allocator<bool>; size_type = long unsigned int]' (did you forget the '()' ?)
   17 |     if(v.size()==k||v.size>21){
      |                     ~~^~~~
      |                           ()
Language: C++

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

using namespace std;
const int Max = 64;
char mp[Max][Max];
int Csum[Max][Max],On[Max][Max],Off[Max][Max];
int Fa[Max*Max],pre[Max][Max];
int getFa(int x){return Fa[x] == -1?x:Fa[x] = getFa(Fa[x]);}
void merge(int x,int y){
    x = getFa(x),y = getFa(y);
    if (x != y) Fa[y] = x;
}
int mv[4][2] = {-1,0,0,1,1,0,0,-1};
void dfs(int x,int y){
    for (int i = 0;i < 4;i++){
        int nx = x+mv[i][0];
        int ny = y+mv[i][1];
    }
}
int main(){
    int R,C,M;
    scanf("%d%d%d",&R,&C,&M);
    for (int i = 0;i < R;i++)
        scanf("%s",mp[i]);
    for (int i = 0;i < R;i++)
        for (int j = 0;j < C;j++)
            scanf("%d",&Csm[i][j]);
    for (int i = 0;i < R;i++)
        for (int j = 0;j < C;j++)
            scanf("%d",&On[i][j]);
    for (int i = 0;i < R;i++)
        for (int j = 0;j < C;j++)
            scanf("%d",&Off[i][j]);
    for (int i = 0;i < M;i++)
        scanf("%d%d",&Vx[i],&Vy[i]);
    memset(Fa,-1,sizeof(Fa));
    dfs(Vx[0],Vy[0]);
    memset(pre,-1,sizeof(pre));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:25: error: 'Csm' was not declared in this scope; did you mean 'Csum'?
   31 |             scanf("%d",&Csm[i][j]);
      |                         ^~~
      |                         Csum
a.cc:39:23: error: 'Vx' was not declared in this scope
   39 |         scanf("%d%d",&Vx[i],&Vy[i]);
      |                       ^~
a.cc:39:30: error: 'Vy' was not declared in this scope
   39 |         scanf("%d%d",&Vx[i],&Vy[i]);
      |                              ^~
a.cc:41:9: error: 'Vx' was not declared in this scope
   41 |     dfs(Vx[0],Vy[0]);
      |         ^~
a.cc:41:15: error: 'Vy' was not declared in this scope
   41 |     dfs(Vx[0],Vy[0]);
      |               ^~
Language: C++

#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int k,i,j;
double l,r,p,t,pp=0,e;

void sleep(double l,double r,double gl,int k)
{
	double h;
	h=(l+r)/2;
	if(gl<0.000001)return 0;
    if(k==0)
	{
		if(fabs(h-t)<=e) pp=pp+gl;
		return ;
	}
	if(h<t)
	{
		sleep(h,r,gl*(1-p),k-1);
		sleep(l,h,gl*p,k-1);
	}
	else
	{
		sleep(l,h,gl*(1-p),k-1);
		sleep(h,r,gl*p,k-1);
	}

}
int main()
{
	scanf("%d %lf %lf",&k,&l,&r);
	scanf("%lf%lf%lf",&p,&e,&t);
	sleep(l,r,1,k);
	printf("%lf\n",pp);
	return 0;
}

Compiler output:
a.cc: In function 'void sleep(double, double, double, int)':
a.cc:12:31: error: return-statement with a value, in function returning 'void' [-fpermissive]
   12 |         if(gl<0.000001)return 0;
      |                               ^
Language: C++

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

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

int R, C, M;
string field[50];
bool visited[50][50];

bool dfs(int px, int py, int gx, int gy, vector<int>& res)
{
	
	if(visited[px][py]) return false;
	visited[px][py] = true;


	if(px == gx && py == gy){
		return true;
	}

	for(int i=0; i<4; i++)
	{
		int tx = px + dx[i];
		int ty = py + dy[i];

		if(tx < 0 || ty < 0 || tx >= C || ty >= R) continue;
		if(field[ty][tx] == '#') continue; 

		if(dfs(tx,ty,gx,gy,res)) {
			res.push_back(ty*50+tx);
			return true;
		}

	}

	return false;
	
}

int main()
{
	cin >> R >> C >> M;

	for(int i=0; i<R; i++)
		cin >> field[i];

	int upkeep[50][50], oncost[50][50], offcost[50][50];
	int objx[1000], objy[1000];

	for(int i=0; i<R; i++)
	for(int j=0; j<C; j++)
		cin >> upkeep[j][i];

	for(int i=0; i<R; i++)
	for(int j=0; j<C; j++)
		cin >> oncost[j][i];

	for(int i=0; i<R; i++)
	for(int j=0; j<C; j++)
		cin >> offcost[j][i];

	for(int i=0; i<M; i++)
		cin >> objy[i] >> objx[i];

	int cost=0;
	vector<vector<int> > route(50*50);
	route[objy[0]*50+objx[0]].push_back(cost++);

	for(int i=0; i<M-1; i++) {
		vector<int> r; 

		memset(visited, 0, sizeof(visited));
		dfs(objx[i], objy[i], objx[i+1], objy[i+1], r);

		reverse(r.begin(), r.end());

		for(int j=0; j<r.size(); j++) {
			int a = r[j];

			route[a].push_back(cost++);
		}
	}

	int res = 0;
	for(int i=0; i<2500; i++) {
		int x = (i % 50);
		int y = (i / 50);

		for(int j=0; j<route[i].size(); j++) {
			if(j+1 == route[i].size()) {

				res += offcost[x][y];
				if(route[i].size() == 1) res += oncost[x][y];
			}
			else {
				if(j==0) res += oncost[x][y];

				int diff = route[i][j+1] - route[i][j];	
				res += min(diff*upkeep[x][y], offcost[x][y] + oncost[x][y]);
			}
		}
	}

	cout << res << endl;

}

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

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

using ld=long double;
int main(){
    int n,m,l;
    cin>>n>>m>>l;
    vector<ld> p(n);
    vector<int> t(n),v(n);
    for(int i=0;i<n;i++){
        cin>>p[i]>>t[i]>>v[i];
        p[i]/=100;
    }

    vector<vector<ld>> pos(n,vector<ld>(m+1,0));
    for(int i=0;i<n;i++){
        for(int j=0;j<=m;j++){
            pos[i][j]=j*log(p[i]+1e-30)+(m-j)*log(1-p[i]+1e-30);
            for(int k=0;k<=m;k++){
                pos
            }
            pos[i][j]=exp(pos[i][j]);
        }
        // vector<vector<ld>> comb(m+1,vector<ld>(m+1,0));
        // comb[0][0]=1;
        // for(int j=0;j<=m;j++){
        //     for(int k=0;k<=j;k++){
        //         if(k==0){
        //             comb[j][k]=(p[i]==1 ? ld(0) : ld(pow(1-p[i],ld(j))));
        //         }
        //         else if(k==j){
        //             comb[j][k]=(p[i]==0 ? ld(0) : ld(pow(p[i],j)));
        //         }
        //         else{
        //             comb[j][k]=comb[j-1][k-1]*p[i]+comb[j-1][k]*(1-p[i]);
        //         }
        //     }
        // }
        // pos[i]=comb[m];
    }
    vector<vector<ld>> possum(n,vector<ld>(m+2));
    for(int i=0;i<n;i++){
        partial_sum(pos[i].begin(),pos[i].end(),possum[i].begin()+1);
    }

    vector<ld> res(n,0);
    for(int i=0;i<n;i++){
        if(v[i]==0) continue;
        for(int x=0;x<=m;x++){
            ld sc=pos[i][x];
            for(int j=0;j<n;j++){
                if(i==j || v[j]==0) continue;
                ld z=0;
                for(int y=0;y<=m;y++){
                    if(l*v[j]+x*t[i]*v[i]*v[j]<l*v[i]+y*t[j]*v[i]*v[j]){
                        z+=pos[j][y];
                    }
                }
                sc*=z;
            }
            res[i]+=sc;
        }
    }
    cout<<setprecision(8)<<fixed;
    for(int i=0;i<n;i++){
        cout<<res[i]<<endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: expected ';' before '}' token
   20 |                 pos
      |                    ^
      |                    ;
   21 |             }
      |             ~
Language: C++


#include<map>
#include<set>
#include<stack>
#include<queue>
#include<cmath>
#include<ctime>
#include<vector>
#include<cctype>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

typedef long long LL;
const double pi=3.141592653;
const double eps=1e-10;
const int INF=0x3f3f3f3f;
const int MOD=10007;
const int MAXN=220;
struct people
{
    double t[MAXN],pp[MAXN];
} peo[MAXN];

int n,m,L,p[MAXN],t[MAXN],v[MAXN];

LL C(LL n,LL m)
{
    LL a=1,b=1;
    for(int i=m; i>=m-n+1; i--)
        a*=i;
    for(int i=1; i<=n; i++)
        b*=i;
    return a/b;
}

double get(int c,int n,double p)
{
    return C(c,n)*pow(p,c)*pow(1-p,n-c);
}

int main()
{
    while(scanf("%d%d%d",&n,&m,&L)!=EOF)
    {
        memset(peo,0,sizeof(peo));
        for(int i=0; i<n; i++)
            scanf("%d%d%d",&p[i],&t[i],&v[i]);
        if(n==1)
        {
            printf("%.8lf\n",v[i]?1:0);
            continue;
        }
        for(int i=0; i<n; i++)
            for(int j=0; j<=m; j++)
            {
                peo[i].t[j]=(L+0.0)/v[i]+j*t[i];
                peo[i].pp[j]=get(j,m,p[i]/100.0);
            }
        for(int i=0; i<n; i++)
        {
            double ans=0;
            for(int j=0; j<=m; j++)
            {
                double tmp=1;
                for(int k=0; k<n; k++)
                {
                    if(k==i||!v[i])
                        continue;
                    double t=0;
                    for(int l=0; l<=m; l++)
                        if(peo[i].t[j]<peo[k].t[l])
                            t+=peo[k].pp[l];
                    tmp*=t;
                }
                ans+=tmp*peo[i].pp[j];
            }
            printf("%.8lf\n",ans);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:32: error: 'i' was not declared in this scope
   53 |             printf("%.8lf\n",v[i]?1:0);
      |                                ^
Language: C++

 t[n][m+1], p[n][m+1], sump[n][m+1];
    for (int i=0; i<n; ++i) {
        double pp, tt;
        cin >> pp>>tt>>v[i];
        pp/=100;
        
        for (int k=0; k<=m; ++k) {
            p[i][k] = 1;
            for (int l=0; l<=m; ++l) {
                if (l < k) p[i][k] *= m-l;
                if (k-l >= 1) {
                    p[i][k] /= k-l;
                }
                if (l<k) p[i][k] *= pp;
                if (l<m-k) p[i][k] *= (1.0-pp);
            }
            t[i][k] = (double)L/v[i] + k*tt;
//            printf("i=%d, k=%d %f\n", i,k,p[i][k]);
            if (k>0)
                sump[i][k] = sump[i][k-1] + p[i][k];
            else
                sump[i][k] = p[i][k];
        }
    }
    
    double ans[n];
    for (int i=0;i<n;++i) ans[i] = 0;

    for (int i=0; i<n; ++i) {
        for (int j=0; j<=m; ++j) {           
            double tmp = p[i][j];
            for (int k=0; k<n; ++k) {
                if (i==k) continue;
                if (upper_bound(t[k], t[k]+m+1, t[i][j])-t[k] == 0) {
                    
//                    printf("zero %d %d\n", i, j);
                    // tmp = 0;
                    // break;
                }
                else 
                    tmp *= (1.0 - sump[k][upper_bound(t[k], t[k]+m+1, t[i][j])-t[k]-1]);
            }
//            printf("%d,%d %f\n", i,j,tmp);
            ans[i] += tmp;
        }
    }

    for (int i=0;i<n;++i)
        printf("%.12f\n", ans[i]);
}

Compiler output:
a.cc:1:2: error: 't' does not name a type
    1 |  t[n][m+1], p[n][m+1], sump[n][m+1];
      |  ^
a.cc:2:5: error: expected unqualified-id before 'for'
    2 |     for (int i=0; i<n; ++i) {
      |     ^~~
a.cc:2:19: error: 'i' does not name a type
    2 |     for (int i=0; i<n; ++i) {
      |                   ^
a.cc:2:24: error: expected unqualified-id before '++' token
    2 |     for (int i=0; i<n; ++i) {
      |                        ^~
a.cc:26:16: error: 'n' was not declared in this scope
   26 |     double ans[n];
      |                ^
a.cc:27:5: error: expected unqualified-id before 'for'
   27 |     for (int i=0;i<n;++i) ans[i] = 0;
      |     ^~~
a.cc:27:18: error: 'i' does not name a type
   27 |     for (int i=0;i<n;++i) ans[i] = 0;
      |                  ^
a.cc:27:22: error: expected unqualified-id before '++' token
   27 |     for (int i=0;i<n;++i) ans[i] = 0;
      |                      ^~
a.cc:29:5: error: expected unqualified-id before 'for'
   29 |     for (int i=0; i<n; ++i) {
      |     ^~~
a.cc:29:19: error: 'i' does not name a type
   29 |     for (int i=0; i<n; ++i) {
      |                   ^
a.cc:29:24: error: expected unqualified-id before '++' token
   29 |     for (int i=0; i<n; ++i) {
      |                        ^~
a.cc:48:5: error: expected unqualified-id before 'for'
   48 |     for (int i=0;i<n;++i)
      |     ^~~
a.cc:48:18: error: 'i' does not name a type
   48 |     for (int i=0;i<n;++i)
      |                  ^
a.cc:48:22: error: expected unqualified-id before '++' token
   48 |     for (int i=0;i<n;++i)
      |                      ^~
a.cc:50:1: error: expected declaration before '}' token
   50 | }
      | ^
Language: C++

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

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b))<EPS)

struct runner{
	int t,v;
	double p;
};

const int INF=1000000000;

vector<runner> vr;
double mem[101][51][101];
// kÍxe·éêÌ
double calcPer(int n,int k,int idx){
	if(!EQ(mem[n][k][idx],INF))
		return mem[n][k][idx];
	double p = vr[idx].p;
	if(k==0)
		return 1.0;
	else{
		return mem[n][k][idx]=(((double)n/k)*calcPer(n-1,k-1,p)*p);
	}
}

int main(){

	int n,m,L;
	for(int i = 0; i < 101; i++)
		for(int j = 0; j < 51; j++)
			for(int k = 0; k < 101; k++)
				mem[i][j][k]=INF;

	cin>>n>>m>>L;
	for(int i = 0; i < n; i++){
		runner r;
		int p;
		cin>>p>>r.t>>r.v;
		r.p=(double)p/100;
		vr.push_back(r);
	}
	// êl¸ÂßÄ¢­
	for(int i = 0; i < n; i++){
		double sumPer=0.0;
		if(vr[i].v==0)
			sumPer=0.0;
		else{
			// ©ªª¢­ÂÌêÅxe·é©
			for(int j = 0; j <= m; j++){
				// »ÝÌxeÅxe·ém¦
				double cper=calcPer(m,j,i)*pow((double)(1-vr[i].p),m-j);
				double selfTime=((double)L/vr[i].v)+vr[i].t*j;
				// »ê¼êÌGÉÂ¢Ä²×é
				for(int k = 0; k < n; k++){
					// ©ª©gÜ½ÍA¬xª0Ìi[Í³·é
					if(i==k||EQ(vr[k].v,0.0))
						continue;
					double enemPer=1.0;
					// èª¢­ÂÈãÌêÅxeµ½çAÔÉ¤©ð`FbN
					for(int l = 0; l <= m; l++){
						// GÌBðvZ
						double enemyTime=((double)L/vr[k].v)+vr[k].t*l;
						// àµGÌBÔª©ªÌBÔðºñÁ½çI¹
						if(EQ(enemyTime,selfTime)||enemyTime>selfTime){
							break;
						}
						// ±ÌÌêÅxe·ém¦
						double p=calcPer(m,l,k)*pow((double)(1-vr[k].p),m-l);
						enemPer-=p;
					}
					// »ÝcÁÄ¢ém¦ªAGª©ªæèx­B·ém¦
					cper*=enemPer;
				}
				// cperª»Ìm¦
				sumPer+=cper;
			}
		}
		printf("%.7f\n",sumPer);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:60: error: 'pow' was not declared in this scope
   55 |                                 double cper=calcPer(m,j,i)*pow((double)(1-vr[i].p),m-j);
      |                                                            ^~~
Language: C++

//10
#include<iostream>
#include<vector>
#include<utility>
#include<cmath>
#include<algorithm>

using namespace std;

double fact(int x){
  double r=1;
  while(x){
    r*=x--;
  }
  return r;
}

int main(){
  int n,m,l;
  cin>>n>>m>>l;
  double ap[100][51],acp[100][52]={{}};
  double at[100][51];
  for(int i=0;i<n;i++){
    double p,t,v;
    cin>>p>>t>>v;
    for(int j=0;j<=m;j++){
      at[i][j]=l/v+t*j;
      ap[i][j]=pow(p/100,j)*pow(1-p/100,m-j)*fact(m)/fact(j)/fact(m-j);
      acp[i][j+1]=acp[i][j]+ap[i][j];
    }
  }
  for(int i=0;i<n;i++){
    double a=0;
    for(int j=0;j<=m;j++){
      double c=ap[i][j];
      for(int k=0;k<n;k++){
	if(i!=k){
	  int x=lower_bound(at[k],at[k]+m+1,at[i][j]+x1e-9)-at[k];
	  c*=1-acp[k][x];
	}
      }
      a+=c;
    }
    cout<<fixed<<a<<endl;	  
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:54: error: 'x1e' was not declared in this scope
   38 |           int x=lower_bound(at[k],at[k]+m+1,at[i][j]+x1e-9)-at[k];
      |                                                      ^~~
Language: C++

#include<iostream>
#include<queue>
using namespace std;

const int inf=1000000000;
const int N=305;
int n,a[N][N],pre[N],l[N],ans,e[N*N][2],c[N*N];
queue <int> Q;

int min(int x,int y)
{
    if (x<y) return x; else return y;
}

void addflow(int s,int t,int d)
{
     int i=t;
     int j=pre[t];
     while (i!=s)
     {
           a[i][j]+=d;
           a[j][i]-=d;
           i=j;
           j=pre[i];
     }
     ans+=d;
}

void flow(int s,int t)
{
    int i,x;
    while (1)
    {

          memset(pre,-1,sizeof(pre));
          while (!Q.empty()) Q.pop();
          Q.push(s);
          l[s]=inf;
          while (!Q.empty())
          {
                x=Q.front(); Q.pop();
                for (i=1; i<=n; i++)
                    if ((a[x][i]>0)&& (pre[i]==-1))
                     {
                                  l[i]=min(l[x],a[x][i]);
                                  pre[i]=x;
                                  Q.push(i);
                                  if (i==t) break;
                     }
                if (pre[t]!=-1) break;
          }
          if (pre[t]!=-1) addflow(s,t,l[t]); else return ;
    }
}
int main()
{
    int m,i,x,y,l,s,t,res;
    scanf("%d%d",&n,&m);
    memset(a,0,sizeof(a));
    for (i=1; i<=m; i++)
    {
            scanf("%d%d",&x,&y);
            a[x][y]++; a[y][x]++;
            e[i][0]=x; e[i][1]=y;
    }
    ans=0; res=0;
    scanf("%d%d",&s,&t);
    flow(s,t);
    cout<<ans<<endl;
    for (i=1; i<=m; i++)
    {
        x=e[i][0]; y=e[i][1];
        if (a[x][y]>0 && a[y][x]==0)
        {
            res++;
            c[i]=1;
        }
    }
    cout<<res<<endl;
    for (i=1; i<=m; i++) if (c[i]) printf("%d\n",i);
}

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

#include<iostream>
#include<cstdio>
#include<algorithm>
#define rep(i,a,b) for(int i=a;i<=b;++i)
using namespace std;
const int maxn=22;
int n,a[maxn];
double f[maxn][200010];
//f[i][j]=min(f[i-1][p]+(a[i]-p)/a[i] (j%p==0))
int main()
{
	//freopen("in.txt","r",stdin);
	cin>>n;
	rep(i,1,n)cin>>a[i];
	sort(a+1,a+n+1);
	rep(i,0,n-1){
		rep(j,1,200000){
			for(int k=j;k<=200000;k+=j){
				double tmp=(double)abs(a[i+1]-k)/a[i+1];
				if(i!=0)tmp=max(tmp,f[i][j]);
				f[i+1][k]=(f[i+1][k]==0?tmp:min(f[i+1][k],tmp));
			}
		}
	}
	double ans=f[n][1];
	rep(i,2,200000)ans=min(ans,f[n][i]);
	//cout<<ans<<endl;
	printf("%.9lf\n",ans);
	return 0;
}

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

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

using namespace std;

const int inf = 0xfffffff;

double a[22];
double dp[22][212345];
void init(){
	for(int i=0;i<22;i++){
		for(int j=0;j<212345;j++){
			dp[i][j]=inf;
		}
	}
}
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF){
		for(int i=0;i<n;i++)scanf("%lf",&a[i]);
		sort(a,a+n);
		init();
		for(int i=1;i<212345;i++)dp[0][i]=fabs(a[0]-i)/a[0];
		for(int i=1;i<n;i++){
			for(int j=1;j<212345;j++){
				for(int k=j;k<212345;k+=j){
					dp[i][k]=min(dp[i][k],max(dp[i-1][j],fabs(a[i]-k)/a[i]));
				}
			}
		}
		//cout<<dp[0][6]<<endl;
		//cout<<dp[1][12]<<endl;
		double Min = 99999999;
		for(int i=1;i<212345;i++){
			Min=min(dp[n-1][i],Min);
		}
		printf("%.10f\n",Min);
	}
}

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

#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
int gcd(int a,int b) {return b==0?a:gcd(b,a%b);}
struct ConfusionRatio
{
    int fm,fz;
    ConfusionRatio(int a=1,int b=1)
    {
        int g=gcd(a,b);
        fz=a/g;
        fm=b/g;
    }
    bool operator < (const ConfusionRatio &t) const
    {
        return (fz*1LL*t.fm-fm*1LL*t.fz)<=0;
    }
    bool operator == (const ConfusionRatio &t)
    {
        return (fz*1LL*t.fm-fm*1LL*t.fz)==0;
    }
}t[2000005];
int n,a[25];
bool dp[21][200002];
bool check(int id)
{
    int l[25],r[25];
    for(int i=0;i<n;++i)
    {
        __int64 delt=t[id].fz*1LL*a[i]/t[id].fm;
        l[i]=(int)max(1LL,a[i]-delt);
        r[i]=(int)min(2*a[i]-1LL,a[i]+delt);
    }
    memset(dp,0,sizeof(dp));
    for(int i=l[0];i<=r[0];++i) dp[0][i]=1;
    for(int i=0;i<n-1;++i)
    {
        for(int j=l[i];j<=r[i];++j)
        {
            if(!dp[i][j]) continue;
            int m1=l[i+1]/j,m2=r[i+1]/j;
            while(m1*j<l[i+1]) m1++;
            for(int t=m1;t<=m2;++t) dp[i+1][t*j]=1;
        }
    }
    for(int i=l[n-1];i<=r[n-1];++i) if(dp[n-1][i]) return true;
    return false;
}
int main()
{
    //freopen("in.txt","r",stdin);
    int m=0;
    scanf("%d",&n);
    t[m++]=ConfusionRatio(0,1);
    for(int i=0;i<n;++i)
    {
        scanf("%d",&a[i]);
        for(int j=1;j<a[i];++j) t[m++]=ConfusionRatio(j,a[i]);
    }
    sort(t,t+m);
    int N=0;
    for(int i=0;i<m;)
    {
        t[N++]=t[i];
        int j=i+1;
        while(j<m&&(t[j]==t[i])) j++;
        i=j;
    }
    int l=0,r=N-1;
    while(l+1<r)
    {
        int mid=(l+r)>>1;
        if(check(mid)) r=mid;
        else l=mid+1;
    }
    if(check(l)) printf("%.12f\n",t[l].fz*1.0/t[l].fm);
    else printf("%.12f\n",t[r].fz*1.0/t[r].fm);
    return 0;
}

Compiler output:
a.cc: In function 'bool check(int)':
a.cc:33:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   33 |         __int64 delt=t[id].fz*1LL*a[i]/t[id].fm;
      |         ^~~~~~~
      |         __ynf64
a.cc:34:32: error: 'delt' was not declared in this scope
   34 |         l[i]=(int)max(1LL,a[i]-delt);
      |                                ^~~~
Language: C++

#include<stdio.h>
int a[30];
double dp[30][200005];
double Abs(double x){
	return x>=0?x:-x;
}
main(){
	int n;
	int i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	int j;
	int Max=a[n-1]*2;
	for(i=0;i<n;i++)
		for(j=1;j<Max;j++)
			dp[i][j]=0x3f3f3f3f;
	for(i=1;i<Max;i++)
		dp[0][i]=Abs((double)(a[0]-i)/a[0]);
	int o;	
	double ans;
	for(i=1;i<n;i++)
		for(j=1;j<Max;j++){
			for(o=j;o<Max;o=o+j){
				ans=Abs((double)(a[i]-o)/a[i]);
				if(ans<dp[i-1][j])
				ans=dp[i-1][j];
				if(ans<dp[i][o])
				dp[i][o]=ans;
			}
		}
	double ans=0x3f3f3f3f;	
	for(i=1;i<Max;i++){
		if(ans>dp[n-1][i])
		ans=dp[n-1][i];	
	}				
	printf("%.12lf",ans);
}

Compiler output:
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:33:16: error: redeclaration of 'double ans'
   33 |         double ans=0x3f3f3f3f;
      |                ^~~
a.cc:22:16: note: 'double ans' previously declared here
   22 |         double ans;
      |                ^~~
Language: C++

#include <bits/stdc++.h>
#define N 30
using namespace std;
typedef long long ll;
int n,A[N];

unordered_map<ll,double> mem[N];
double calc(double a,double b){return abs(a-b)/a;}

double dfs(int idx,ll num){
  if(idx==n) return 0;
  if(mem[idx].count(num))return mem[idx][num];

  double res=1LL<<55;
  for(int i=num;;i+=num){
    res=min(res,max(calc(A[idx],i),dfs(idx+1,i)));
    if(i>A[n-1])break;
  }
  return mem[idx][num]=res;
}

int main(){
  cin>>n;
  for(int i=0;i<n;i++)cin>>A[i];
  printf("%.10f\n",dfs(0,1););
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:28: error: expected ')' before ';' token
   25 |   printf("%.10f\n",dfs(0,1););
      |         ~                  ^
      |                            )
a.cc:25:29: error: expected primary-expression before ')' token
   25 |   printf("%.10f\n",dfs(0,1););
      |                             ^
Language: C++

#include <vector>
#include <bitset>
#include <map>
#include <queue>
#include <climits>
#include <algorithm>
#include <iostream>
#include <cmath>
using namespace std;

const double INF = DBL_MAX / 2;

int main()
{
	int n;
	cin >> n;

	vector<int> a(n);
	for(int i=0; i<n; ++i)
		cin >> a[i];

	int m = a[n-1] * 2;
	vector<double> dp(m, INF);
	dp[1] = 0;
	for(int i=0; i<n; ++i){
		vector<double> nextDp(m, INF);
		for(int j=1; j<m; ++j){
			for(int k=j; k<m; k+=j){
				nextDp[k] = min(nextDp[k], max(dp[j], abs(a[i]-k)/(double)a[i]));
			}
		}
		dp.swap(nextDp);
	}

	double ret = INF;
	for(int i=0; i<m; ++i)
		ret = min(ret, dp[i]);
	printf("%.10f\n", ret);

	return 0;
}

Compiler output:
a.cc:11:20: error: 'DBL_MAX' was not declared in this scope
   11 | const double INF = DBL_MAX / 2;
      |                    ^~~~~~~
a.cc:9:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
    8 | #include <cmath>
  +++ |+#include <cfloat>
    9 | using namespace std;
Language: C++

// OBツ嘉ッツ嘉債宿2011 Day3 F : Beautiful Currency

#include <iostream>
#include <cstdio>
#include <stdlib>

using namespace std;

int main(){
	int N;
	int a[20];
	while(cin >> N){
		for(int i=0;i<N;i++) cin >> a[i];
		static double dp[2][200001];
		for(int i=1;i<=200000;i++){
			dp[0][i] = abs(a[0]-i)/(double)a[0];
		}
		int cur = 0, next = 1;
		for(int i=1;i<N;i++){
			for(int j=0;j<=200000;j++) dp[next][j] = 1e12;
			for(int j=1;j<=200000;j++)
				for(int k=j;k<=200000;k+=j)
					dp[next][k] = min(dp[next][k], max(dp[cur][j], abs(a[i]-k)/(double)a[i]));
			swap(cur, next);
		}
		double res = 1e12;
		for(int i=1;i<=200000;i++) res = min(res, dp[cur][i]);
		printf("%.10lf\n", res);
	}
}

Compiler output:
a.cc:5:10: fatal error: stdlib: No such file or directory
    5 | #include <stdlib>
      |          ^~~~~~~~
compilation terminated.
Language: Java

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

int c[109][109], n, m, p, q, r, maxn;

void dfs(vector<int>vec) {
	if (vec.size() >= 2) {
		int sum = 0;
		for (int i = 0; i < vec.size(); i++) {
			int minx = 1000009;
			for (int j = 0; j < vec.size(); j++) {
				if (i == j) continue;
				minx = min(minx, c[vec[i]][vec[j]]);
				if (minx == 0) return;
			}
			sum += minx;
		}
		maxn = max(maxn, sum);
	}
	int T = 1; if (vec.size() >= 1) T = vec[vec.size() - 1] + 1;
	for (int i = T; i <= n; i++) {
		vector<int>F = vec; F.push_back(i);
		dfs(F);
	}
}

int main() {
	cin >> n >> m;
	for (int i = 1; i <= m; i++) {
		cin >> p >> q >> r;
		c[p][q] = r; c[q][p] = r;
	}
	dfs(vector<int>{});
	cout << maxn << endl;
	return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <vector>
^
Main.java:3: error: illegal character: '#'
#include <algorithm>
^
Main.java:6: error: class, interface, enum, or record expected
int c[109][109], n, m, p, q, r, maxn;
^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
void dfs(vector<int>vec) {
^
  (use --enable-preview to enable unnamed classes)
Main.java:30: error: not a statement
	cin >> n >> m;
	         ^
Main.java:32: error: not a statement
		cin >> p >> q >> r;
		              ^
Main.java:36: error: not a statement
	cout << maxn << endl;
	             ^
Main.java:35: error: '.class' expected
	dfs(vector<int>{});
	              ^
Main.java:35: error: illegal start of expression
	dfs(vector<int>{});
	               ^
Main.java:35: error: illegal start of expression
	dfs(vector<int>{});
	                 ^
11 errors