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

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

using namespace std;

const int MAX_N=4100000;
typedef long long ll;
// ZOgØðÂO[ozñ
// 0 <-> h*w-1ÌindexÉÀf[^ª¶Ý
ll dat[2*MAX_N-1];
int h,w;
const ll INF=0x7f7f7f7f7f7f7f7f;
// ú»
void init(int h_,int w_){
    h=1;
    w=1;
    while(h<h_)
        h*=2;
    while(w<w_)
        w*=2;
    memset(dat,0x7f,sizeof(dat));
   // fill(dat,dat+2*h*w-1,INF);
}
// kÔÚÌl(0-indexed)ðaÉÏX
void update(int k,int a){
    // tÌß_
    k+=(h*w-1);
    dat[k]=a;
    // ÌÚèÈªçXV
    while(k>0){
        k=(k-1)/2;
        //if(dat[k*2+2]==-1)
        //    dat[k]=dat[k*2+1];
        //else if(dat[k*2+1]==-1)
        //    dat[k]=dat[k*2+2];
        //else
        //    dat[k]=min(dat[k*2+1],dat[k*2+2]);
        dat[k]=min(dat[k*2+1],dat[k*2+2]);
    }
}
ll query(int qminx,int qminy,int qmaxx,int qmaxy,int k,int minx,int miny,int maxx,int maxy){
    // dÈçÈ¢
    if(qmaxx<minx||maxx<qminx||qmaxy<miny||maxy<qminy)
        return INF;
    // ¡ñÌÌæª®SÉÜÜêé
    else if(minx>=qminx&&qmaxx>=maxx&&miny>=qminy&&qmaxy>=maxy)
        return dat[k];
    ll vl,vr;
    // ÅÍ¡Éª
    if(miny!=maxy){
        int midY=(miny+maxy)/2;
        vl=query(qminx,qminy,qmaxx,qmaxy,k*2+1,minx,miny,maxx,midY);
        vr=query(qminx,qminy,qmaxx,qmaxy,k*2+2,minx,midY+1,maxx,maxy);
    }
    // ªµ«Á½çc
    else{
        int midX=(minx+maxx)/2;
        vl=query(qminx,qminy,qmaxx,qmaxy,k*2+1,minx,miny,midX,maxy);
        vr=query(qminx,qminy,qmaxx,qmaxy,k*2+2,midX+1,miny,maxx,maxy);
    }
    //if(vr==-1)
    //    return vl;
    //else if(vl==-1)
    //    return vr;
    return min(vl,vr);
}

int main(){
    int r,c,q;
    while(scanf("%d %d %d\n",&r,&c,&q)&&!(r==0&&c==0&&q==0)){
        init(r,c);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < c; j++){
                int t;
                scanf("%d",&t);
                update(i*w+j,t);
            }
        }
        for(int i = 0; i < q; i++){
            int a,b,c,d;
            scanf("%d %d %d %d\n",&a,&b,&c,&d);
            ll res=query(b,a,d,c,0,0,0,w-1,h-1);
            printf("%d\n",res);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'void init(int, int)':
a.cc:24:5: error: 'memset' was not declared in this scope
   24 |     memset(dat,0x7f,sizeof(dat));
      |     ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <cstdio>
  +++ |+#include <cstring>
    6 |
Language: C++

#include <cstdio>
#include <cstring>
#include <climits>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int H, W;
	int Q;
	
	while (1){
		scanf("%d %d %d", &H, &W, &Q);
		
		if (H + W + Q == 0){
			break;
		}
		
		int Hs = (int)sqrt(H) + 1;
		int Ws = (int)sqrt(W) + 1;
		
		vector<vector<int> > grid(H, vector<int>(W));
		vector<vector<int> > cmp(Hs, vector<int>(Ws));
		
		for (int i = 0; i < Hs; i++){
			for (int j = 0; j < Ws; j++){
				cmp[i][j] = INT_MAX;
			}
		}
		
		for (int i = 0; i < H; i++){
			for (int j = 0; j < W; j++){
				scanf("%d", &grid[i][j]);
				cmp[i / Hs][j / Ws] = min(cmp[i / Hs][j / Ws], grid[i][j]);
			}
		}
		
		for (int i = 0; i < Hs; i++){
			for (int j = 0; j < Ws; j++){
				printf("%d%c", cmp[i][j], j == Ws - 1 ? '\n' : ' ');
			}
		}
		
		for (int i = 0; i < Q; i++){
			int h1, w1, h2, w2;
			scanf("%d %d %d %d", &h1, &w1, &h2, &w2);
			int res = INT_MAX;
			
			for (int j = 0; j < Hs; j++){
				for (int k = 0; k < Ws; k++){
					if (h1 <= j * Hs && (j + 1) * Hs < h2
								&& w1 <= k * Ws && (k + 1) * Ws < w2){
						res = min(res, cmp[j][k]);
					}
					else {
						for (int l = max(j * Hs, h1); l <= min((j + 1) * Hs, h2); l++){
							for (int m = max(k * Ws, w1); k <= min((k + 1) * Ws, w2); k++){
								res = min(res, grid[l][m]);
							}
						}
					}
				}
			}
			
			printf("%d\n", res);
		}
	}
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: 'sqrt' was not declared in this scope
   21 |                 int Hs = (int)sqrt(H) + 1;
      |                               ^~~~
Language: C++

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

typedef int type;
const type INIT = INT_MAX;

class segment_tree {
private:
	int n;
	vector<type> dat;

    inline type function(type a, type b) const {
		return min(a, b);
	}

	type query(int a, int b, int k, int l, int r) const {
		if(r <= a || b <= l)
			return INIT;

		if(a <= l && r <= b) {
			return dat[k];
		}
		else {
			const type vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
			const type vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
			return function(vl, vr);
		}
	}

public:
	segment_tree(int n_) {
		n = 1;
		while(n < n_) n *= 2;
		dat.resize(2 * n - 1, INIT);
	}

	inline void update(int k, type a) {
		k += n - 1;
		dat[k] = a;

		while(k > 0) {
			k = (k - 1) / 2;
			dat[k] = function(dat[k * 2 + 1], dat[k * 2 + 2]);
		}
	}

	inline type query(int a, int b) const {
		return query(a, b, 0, 0, n);
	}

	const vector<type>& data() const {
		return dat;
	}

	void merge(const segment_tree& s) {
		const vector<type>& tmp = s.data();
		if(dat.size() != tmp.size()) return;
		for(int i = 0; i < (int)dat.size(); ++i) {
			dat[i] = function(dat[i], tmp[i]);
		}
	}
};

class segment_tree_2d {
private:
	int n;
	vector<segment_tree> dat;

    inline type function(type a, type b) const {
		return min(a, b);
	}

	type query(int r1, int r2, int c1, int c2, int k, int l, int r) const {
		if(r <= r1 || r2 <= l)
			return INIT;

		if(r1 <= l && r <= r2) {
			return dat[k].query(c1, c2);
		}
		else {
			const type vl = query(r1, r2, c1, c2, k * 2 + 1, l, (l + r) / 2);
			const type vr = query(r1, r2, c1, c2, k * 2 + 2, (l + r) / 2, r);
			return function(vl, vr);
		}
	}

public:
	segment_tree_2d(int r, int c) {
		n = 1;
		while(n < r) n *= 2;
		dat.resize(2 * n - 1, segment_tree(c));
	}

	inline void update(int y, int x, type a) {
		y += n - 1;
		dat[y].update(x, a);

		while(y > 0) {
			const int child = y;
			y = (y - 1) / 2;
			dat[y].merge(dat[child]);
		}
	}

	inline type query(int r1, int r2, int c1, int c2) const {
		return query(r1, r2, c1, c2, 0, 0, n);
	}
};

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

	for(int r, c, q; cin >> r >> c >> q, r;) {
		segment_tree_2d seg(r, c);
		for(int i = 0; i < r; ++i) {
			for(int j = 0; j < c; ++j) {
				int in;
				cin >> in;
				seg.update(i, j, in);
			}
		}

		for(int i = 0; i < q; ++i) {
			int r1, r2, c1, c2;
			cin >> r1 >> c1 >> r2 >> c2;
			cout << seg.query(r1, r2 + 1, c1, c2 + 1) << endl;
		}
	}

	return EXIT_SUCCESS;
}

Compiler output:
a.cc:8:19: error: 'INT_MAX' was not declared in this scope
    8 | const type INIT = INT_MAX;
      |                   ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
#include<functional>
#include<climits>

using namespace std;


template<class S=int, class T=std::less<S>, S nil=INT_MAX>
class RMQ{
friend class RMQ2D;
	S *dat;

	static int calcsize(int n){
		int res=1;
		while(res<n)res<<=1;
		return res;
	}
public:
	RMQ():dat(0){
	}
	~RMQ(){
		delete[] dat;
	}
	void build(int n,const S a[]){
		int m=n;
		n=calcsize(n);
		dat=new S[2*n-1];
		for(int i=0;i<m;i++)dat[n-1+i]=a[i];
		for(int i=m;i<n;i++)dat[n-1+i]=nil;
		for(int i=n-2;i>=0;i--){
			dat[i]=std::min(dat[i*2+1],dat[i*2+2],T());
		}
	}
	void update(int k,int a,int k,int l,int r){//k番目をaに変更
		k+=n-1;
		dat[k]=a;
		while(k>0){
			k=(k-1)/2;
			dat[k]=std::min(dat[k*2+1],dat[k*2+2],T());
		}
	}
	S query(int a,int b,int k,int l,int r)const{//[a,b)の最小(大)値
		if(r<=a||b<=l)return nil;
		if(a<=l&&r<=b)return dat[k];
		else{
			S vl=query(a,b,k*2+1,l,(l+r)/2);
			S vr=query(a,b,k*2+2,(l+r)/2,r);
			return std::min(vl,vr,T());
		}
	}
};

class RMQ2D{
	typedef unsigned int S;
	typedef std::less<S> T;
	static const S nil=~0u;
	int h,w;
	RMQ<S,T,nil> *rmq;
	int query(int a,int b,int k,int l,int r,int xs,int xe)const{
		if(r<=a||b<=l)return nil;
		if(a<=l&&r<=b)return rmq[k].query(xs,xe, 0,0,w);
		else{
			S vl=query(a,b,k*2+1,l,(l+r)/2,xs,xe);
			S vr=query(a,b,k*2+2,(l+r)/2,r,xs,xe);
			return std::min(vl,vr);
		}
	}
public:
	RMQ2D(int h,int w,const S a[]){
		S *dat;
		int n=h,m=w;
		h=this->h=RMQ<S,T,nil>::calcsize(h);
		w=this->w=RMQ<S,T,nil>::calcsize(w);
		dat=new S[2*w-1];
		for(int i=0;i<w;i++)dat[i]=nil;
		rmq=new RMQ<S,T,nil>[2*h-1];
		for(int i=0;i<n;i++)rmq[h-1+i].build(m,a+i*m);
		for(int i=n;i<h;i++)rmq[h-1+i].build(m,dat);
		for(int i=h-2;i>=0;i--){
			rmq[i].build(m,dat);
			for(int j=0;j<2*w-1;j++)
				rmq[i].dat[j]=std::min(rmq[i*2+1].dat[j],rmq[i*2+2].dat[j],T());
		}
		delete[] dat;
	}
	~RMQ2D(){
		delete[] rmq;
	}
	void update(int y,int x,int a){
		//「あとで」
	}
	int query(int ys,int ye,int xs,int xe)const{//[ys,ye)+[xs,xe)の最小(大)値
		return query(ys,ye,0,0,h,xs,xe);
	}
};

unsigned int g[1000000];
int main(){
	int r,c,q;
	while(cin>>r>>c>>q,r|c|q){
		for(int i=0;i<r*c;i++)cin>>g[i];
		RMQ2D rmq(r,c,g);
		for(int i=0;i<q;i++){
			int y1,x1,y2,x2;
			cin>>y1>>x1>>y2>>x2;
			cout<<rmq.query(y1,y2+1,x1,x2+1)<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:35:37: error: redefinition of 'int k'
   35 |         void update(int k,int a,int k,int l,int r){//k番目をaに変更
      |                                 ~~~~^
a.cc:35:25: note: 'int k' previously declared here
   35 |         void update(int k,int a,int k,int l,int r){//k番目をaに変更
      |                     ~~~~^
a.cc: In member function 'void RMQ<S, T, nil>::update(...)':
a.cc:36:20: error: 'n' was not declared in this scope
   36 |                 k+=n-1;
      |                    ^
Language: C++

#include<iostream>
#include<algorithm>
#include<functional>
#include<climits>

using namespace std;


template<class S=int, class T=std::less<S>, S nil=INT_MAX>
class RMQ{
friend class RMQ2D;
	S *dat;

	static int calcsize(int n){
		int res=1;
		while(res<n)res<<=1;
		return res;
	}
public:
	RMQ():dat(0){
	}
	~RMQ(){
		delete[] dat;
	}
	void build(int n,const S a[]){
		int m=n;
		n=calcsize(n);
		dat=new S[2*n-1];
		for(int i=0;i<m;i++)dat[n-1+i]=a[i];
		for(int i=m;i<n;i++)dat[n-1+i]=nil;
		for(int i=n-2;i>=0;i--){
			dat[i]=std::min(dat[i*2+1],dat[i*2+2],T());
		}
	}
	void update(int k,int a){//k番目をaに変更
		k+=n-1;
		dat[k]=a;
		while(k>0){
			k=(k-1)/2;
			dat[k]=std::min(dat[k*2+1],dat[k*2+2],T());
		}
	}
	S query(int a,int b,int k,int l,int r)const{//[a,b)の最小(大)値
		if(r<=a||b<=l)return nil;
		if(a<=l&&r<=b)return dat[k];
		else{
			S vl=query(a,b,k*2+1,l,(l+r)/2);
			S vr=query(a,b,k*2+2,(l+r)/2,r);
			return std::min(vl,vr,T());
		}
	}
};

class RMQ2D{
	typedef unsigned int S;
	typedef std::less<S> T;
	static const S nil=~0u;
	int h,w;
	RMQ<S,T,nil> *rmq;
	int query(int a,int b,int k,int l,int r,int xs,int xe)const{
		if(r<=a||b<=l)return nil;
		if(a<=l&&r<=b)return rmq[k].query(xs,xe, 0,0,w);
		else{
			S vl=query(a,b,k*2+1,l,(l+r)/2,xs,xe);
			S vr=query(a,b,k*2+2,(l+r)/2,r,xs,xe);
			return std::min(vl,vr);
		}
	}
public:
	RMQ2D(int h,int w,const S a[]){
		S *dat;
		int n=h,m=w;
		h=this->h=RMQ<S,T,nil>::calcsize(h);
		w=this->w=RMQ<S,T,nil>::calcsize(w);
		dat=new S[2*w-1];
		for(int i=0;i<w;i++)dat[i]=nil;
		rmq=new RMQ<S,T,nil>[2*h-1];
		for(int i=0;i<n;i++)rmq[h-1+i].build(m,a+i*m);
		for(int i=n;i<h;i++)rmq[h-1+i].build(m,dat);
		for(int i=h-2;i>=0;i--){
			rmq[i].build(m,dat);
			for(int j=0;j<2*w-1;j++)
				rmq[i].dat[j]=std::min(rmq[i*2+1].dat[j],rmq[i*2+2].dat[j],T());
		}
		delete[] dat;
	}
	~RMQ2D(){
		delete[] rmq;
	}
	void update(int y,int x,int a){
		//「あとで」
	}
	int query(int ys,int ye,int xs,int xe)const{//[ys,ye)+[xs,xe)の最小(大)値
		return query(ys,ye,0,0,h,xs,xe);
	}
};

unsigned int g[1000000];
int main(){
	int r,c,q;
	while(cin>>r>>c>>q,r|c|q){
		for(int i=0;i<r*c;i++)cin>>g[i];
		RMQ2D rmq(r,c,g);
		for(int i=0;i<q;i++){
			int y1,x1,y2,x2;
			cin>>y1>>x1>>y2>>x2;
			cout<<rmq.query(y1,y2+1,x1,x2+1)<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In member function 'void RMQ<S, T, nil>::update(int, int)':
a.cc:36:20: error: 'n' was not declared in this scope
   36 |                 k+=n-1;
      |                    ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
const int MAXN = 1000005;
long long map[MAXN];
int main()
{
	long long Mina;
	int i, j, r, c1, q;
	int a, b, c, d;
	while( cin >> r >> c1 >> q ) {
		if( r == 0 && c == 0 && q == 0 )
			break;
		for( i = 0 ; i < r ; ++i ) {
			for( j = 0 ; j < c1 ; ++j ) {
				scanf( "%lld" , &map[i*c1+j] );
			}
		}
		while( q -- ) {
			cin >> a >> b >> c >> d;
			Mina = map[a*c1+b];
			for( i = a ; i <= c ; ++ i ) {
				for( j = b + 1 ; j <= d ; ++j ) {
					if( map[i*c1+j] < min )
						Mina = map[i*c1+j];
				}
			}
			printf( "%lld\n" , Mina );
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:57: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<'
   24 |                                         if( map[i*c1+j] < min )
      |                                             ~~~~~~~~~~~~^~~~~
Language: C

// Aizu Vol-10 1069: Squid Multiplication
// 2017.8.18 bal4u@uu

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

typedef unsigned long long ulong;
ulong odd[255], even[255];
int ol, el;

ulong gcd(ulong a, ulong b)
{
	ulong r;
	while (b != 0) r = a % b, a = b, b = r;
	return a;
}

int cmp(ulong *a, ulong *b) {
	if (*a < *b) return -1;
	if (*a == *b) return 0;
	return 1;
}

int main()
{
	int n, k, i;
	ulong g, g2, e1, e2, o1;

	while (scanf("%d", &n) && n) {
		k = n*(n + 1) / 2;
		for (ol = el = 0, i = 0; i < k; i++) {
			scanf("%llu", &g);
			if (g & 1) odd[ol++] = g;
			else       even[el++] = g;
		}
		qsort(odd, ol, sizeof(ulong), cmp);
		qsort(even, el, sizeof(ulong), cmp);
		e1 = even[0], e2 = even[1], o1 = odd[0];
		g = gcd(e1, e2);
		g2 = gcd(g, o1); g /= g2, o1 /= g2;
		g2 = gcd(g, o1); g /= g2, o1 /= g2;
		printf("%llu\n%llu", g, even[0]/g);
		for (i = 1; i < n; i++) printf(" %llu", even[i]/g);
		putchar('\n');
	}
	return 0;
}

Compiler output:
main.c:7:28: error: conflicting types for 'ulong'; have 'long long unsigned int'
    7 | typedef unsigned long long ulong;
      |                            ^~~~~
In file included from /usr/include/stdlib.h:514,
                 from main.c:5:
/usr/include/x86_64-linux-gnu/sys/types.h:148:27: note: previous declaration of 'ulong' with type 'ulong' {aka 'long unsigned int'}
  148 | typedef unsigned long int ulong;
      |                           ^~~~~
main.c: In function 'main':
main.c:36:47: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   36 |                 qsort(odd, ol, sizeof(ulong), cmp);
      |                                               ^~~
      |                                               |
      |                                               int (*)(ulong *, ulong *) {aka int (*)(long long unsigned int *, long long unsigned int *)}
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(ulong *, ulong *)' {aka 'int (*)(long long unsigned int *, long long unsigned int *)'}
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:37:48: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   37 |                 qsort(even, el, sizeof(ulong), cmp);
      |                                                ^~~
      |                                                |
      |                                                int (*)(ulong *, ulong *) {aka int (*)(long long unsigned int *, long long unsigned int *)}
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(ulong *, ulong *)' {aka 'int (*)(long long unsigned int *, long long unsigned int *)'}
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C

 #include<stdio.h>
 #include<math.h>
 
 int main()
 {
   __int64 b[32000];
   __int64 a[300];
   int N;
   int i;
   __int64 sum;
   while(scanf("%d",&N),N)
   {
     for(i=0;i<N*(N+1)/2;i++)
       scanf("%lld",&b[i]);
     sum=b[0]*b[1]/b[N];
     a[0]=(__int64)sqrt(sum);
     for(i=1;i<=N;i++)
       a[i]=b[i-1]/a[0];
     printf("%lld\n",a[0]);
     for(i=1;i<N;i++)
       printf("%lld ",a[i]);
     printf("%lld\n",a[N]);                     
   } 
   return 0;   
 }
 
 

Compiler output:
main.c: In function 'main':
main.c:6:4: error: unknown type name '__int64'; did you mean '__int64_t'?
    6 |    __int64 b[32000];
      |    ^~~~~~~
      |    __int64_t
main.c:7:4: error: unknown type name '__int64'; did you mean '__int64_t'?
    7 |    __int64 a[300];
      |    ^~~~~~~
      |    __int64_t
main.c:10:4: error: unknown type name '__int64'; did you mean '__int64_t'?
   10 |    __int64 sum;
      |    ^~~~~~~
      |    __int64_t
main.c:16:12: error: '__int64' undeclared (first use in this function); did you mean '__int64_t'?
   16 |      a[0]=(__int64)sqrt(sum);
      |            ^~~~~~~
      |            __int64_t
main.c:16:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:20: error: expected ';' before 'sqrt'
   16 |      a[0]=(__int64)sqrt(sum);
      |                    ^~~~
      |                    ;
Language: C

 #include<stdio.h>
 #include<math.h>
 
 long long int gcd(long long int x,long long int y)
 {  
   while(x!=y)
   {
     if(x>y) 
       x=x-y;
     else
       y=y-x;           
   }
   return x;
 }
 
 int main()
 {
   long long  b[32000];
   long long  a[300];
   int N;
   int i;
   __int64 sum;
   while(scanf("%d",&N),N)
   {
     for(i=0;i<N*(N+1)/2;i++)
       scanf("%lld",&b[i]);
     a[1]=gcd(b[0],b[N]);
     a[0]=b[0]/a[1];
     for(i=2;i<=N;i++)
       a[i]=b[i-1]/a[0];
     printf("%lld\n",a[0]);
     for(i=1;i<N;i++)
       printf("%lld ",a[i]);
     printf("%lld\n",a[N]);                     
   } 
   return 0;   
 }
 

Compiler output:
main.c: In function 'main':
main.c:22:4: error: unknown type name '__int64'; did you mean '__int64_t'?
   22 |    __int64 sum;
      |    ^~~~~~~
      |    __int64_t
Language: C++

#include<iostream>
#include<algorithm>
#include<string.h>
#include<cstdio>
#include<stack>
using namespace std;

#define LL long long
LL of[309],jf[90009], p[309];

int main(){
	int n;
	while(scanf("%d",&n),n){
		int ol=0,jl=0;
		for(int i=0; i<(n+1)*n/2;i++){
			LL x;
			scanf("%lld",&x);
			if(x%2==0)
				of[ol++] = x;
			else
				jf[jl++] = x;
		}
		sort(of,of+ol);
		sort(jf,jf+jl);
		
		LL a0 = int(sqrt((1.0*of[0]/jf[0]*of[1]))+0.001);
		printf("%lld\n%lld",a0,of[0]/a0);
		for(int i=1;i<n;i++)
			printf(" %lld",of[i]/a0);
		printf("\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:29: error: 'sqrt' was not declared in this scope
   26 |                 LL a0 = int(sqrt((1.0*of[0]/jf[0]*of[1]))+0.001);
      |                             ^~~~
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;
typedef unsigned __int64 LL; 
const int MAXN=300;
LL b,a[MAXN];
int n,m; 
LL gcd(LL a,LL b){
	if (!b) return a;
	else return gcd(b,a%b); 
} 
int main()
{
	while (cin>>n,n){

		m=0; 
		for (int i=0;i<n*(n+1)/2;i++){
			cin>>b; 
			if (b%2==0) a[m++]=b;				
		} 
		LL t=a[0];
		for (int i=1;i<m;i++){
			t=gcd(t,a[i]); 
		}   
		for (int i=0;i<m;i++){
			a[i]/=t;	
		} 
		cout<<t<<'\n';
		sort(a,a+m);
		for (int i=0;i<m-1;i++)cout<<a[i]<<" ";
		cout<<a[m-1]<<'\n'; 
	} 
	return 0; 
} 

Compiler output:
a.cc:8:26: error: expected initializer before 'LL'
    8 | typedef unsigned __int64 LL;
      |                          ^~
a.cc:10:1: error: 'LL' does not name a type
   10 | LL b,a[MAXN];
      | ^~
a.cc:12:1: error: 'LL' does not name a type
   12 | LL gcd(LL a,LL b){
      | ^~
a.cc: In function 'int main()':
a.cc:22:30: error: 'b' was not declared in this scope
   22 |                         cin>>b;
      |                              ^
a.cc:23:37: error: 'a' was not declared in this scope
   23 |                         if (b%2==0) a[m++]=b;
      |                                     ^
a.cc:25:17: error: 'LL' was not declared in this scope
   25 |                 LL t=a[0];
      |                 ^~
a.cc:27:25: error: 't' was not declared in this scope
   27 |                         t=gcd(t,a[i]);
      |                         ^
a.cc:27:33: error: 'a' was not declared in this scope
   27 |                         t=gcd(t,a[i]);
      |                                 ^
a.cc:27:27: error: 'gcd' was not declared in this scope
   27 |                         t=gcd(t,a[i]);
      |                           ^~~
a.cc:30:25: error: 'a' was not declared in this scope
   30 |                         a[i]/=t;
      |                         ^
a.cc:30:31: error: 't' was not declared in this scope
   30 |                         a[i]/=t;
      |                               ^
a.cc:32:23: error: 't' was not declared in this scope; did you mean 'tm'?
   32 |                 cout<<t<<'\n';
      |                       ^
      |                       tm
a.cc:33:22: error: 'a' was not declared in this scope
   33 |                 sort(a,a+m);
      |                      ^
Language: C++

/*
AizuOnline A1069
Squid Multiplication
*/
#include <stdio.h>
#include <math.h>
#include <float.h>

#define DEBUG 1
#define NUMOFODD 250

long long b[NUMOFODD*(NUMOFODD+1)];
int long long evens[300];
int N = 4;
int prime[10]={2,3,5,7,11,13,17,19,23,29};

long long gcd(long long x, long long y){
	return y == 0 ? x: gcd(y, x%y);
}
long long gcd_ml(long long * a,long long n)
{
  if(n==0)return(1);
  if(n==1)return(a[0]);
  return(gcd(a[0],gcd_ml(a+1,n-1)));
}
int comp(long long * x,long long * y)
{
  return(*(int *)x - *(int *)y);
}
void make_test_data(int a[],int n)
{
  int i,j,k;

  k=0;
  for(i=0;i<n-1;i++)
    for(j=i+1;j<n-1;j++)
      b[k++]=a[i]*a[j];
  
  for(i=0;i<k;i++)
    printf("%lld ",b[i]);
  printf("\n");
  
}

main()
{
  int i,j,NN,even_cnt,odd_min,odd_f;
  long long g;
  
  while(EOF != scanf("%d",&N) && N )
    {
      NN = N*(N+1)/2;
      for(i=0;i<NN;i++)
	scanf("%lld ",&(b[i]));
 
      qsort(b,NN,sizeof(long long),comp);
   
      j=0;odd_f=0;
      for(i=0;i<NN;i++)
	if((b[i] % 2)==0) 
	  { evens[j++]=b[i];
	  }
        else
	  {
	    if(odd_f == 0)
	      {
		odd_f = 1;
		odd_min=b[i];
	      }
	  }
      even_cnt=j;

      
      g = sqrt((float)evens[0]*evens[1]/odd_min);

#ifdef DEBUGx
      printf("ec:%d g:%lld\n",even_cnt,g);
#endif
      printf("%lld\n",g);
      for(i=0;i<even_cnt;i++)
	{
	  evens[i]/=g;
	  printf("%lld ",evens[i]);
	}
      printf("\n");
    }
return(0);
}

Compiler output:
a.cc:45:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   45 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:56:36: error: invalid conversion from 'int (*)(long long int*, long long int*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
   56 |       qsort(b,NN,sizeof(long long),comp);
      |                                    ^~~~
      |                                    |
      |                                    int (*)(long long int*, long long int*)
In file included from /usr/include/c++/14/bits/std_abs.h:38,
                 from /usr/include/c++/14/cmath:49,
                 from /usr/include/c++/14/math.h:36,
                 from a.cc:6:
/usr/include/stdlib.h:971:34: note:   initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std ;

long long a0 ;
long long t1[255] ;
long long t2[320000] ;

bool cmp(long long a,long long b){
	return a < b ;
}

long long gcd(long long a,long long b){
	return b?gcd(b,a%b):a;
}

int main(){
	long long n ;
	long long i , j , k ;
	long long top1 ;
	long long top2 ;
	while(scanf("%lld",&n)!=EOF){
		if(n == 0)
			break ;
		top1 = 0 ;
		top2 = 0 ;
		for(i = 0 ; i <= (n*(n+1)/2-1) ; i++){
			long long c ;
			scanf("%lld",&c) ;
			if(c%2)
				t2[top2++] = c ;
			else
				t1[top1++] = c ;
		}
		sort(t1,t1+top1,cmp) ;
		sort(t2,t2+top2,cmp) ;
		long long t = gcd(t1[0],t1[1]) ;
		long long g1 = t1[0] / t ;
		long long g2 = t1[1] / t ;
		long long q = (long long)sqrt(t2[0]/(g1*g2)*1.0) ;
		a0 = t / q ;
		prlong longf("%lld\n",a0) ;
		for(i = 0 ; i < n ; i++){
			if(i == 0){
				prlong longf("%lld",t1[i] / a0) ;
			}
			else
				prlong longf(" %lld",t1[i] / a0) ;
		}
		puts("") ;
	}
	return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:17: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   46 |                 prlong longf("%lld\n",a0) ;
      |                 ^~~~~~
      |                 ulong
a.cc:49:39: error: expected ';' before 'longf'
   49 |                                 prlong longf("%lld",t1[i] / a0) ;
      |                                       ^~~~~~
      |                                       ;
a.cc:52:39: error: expected ';' before 'longf'
   52 |                                 prlong longf(" %lld",t1[i] / a0) ;
      |                                       ^~~~~~
      |                                       ;
Language: C++

#include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	__int64 a[50000],b[50000],c;
	while(scanf("%d",&n)!=EOF)
	{
		int j=0,k=0;
		if(n==0)
			break;
		int i;
		for(i=0;i<n*(n+1)/2;i++)
		{
			scanf("%I64d",&c);
			if(c%2==0)
			{
				a[j]=c;
				j++;
			}
			else
			{
				b[k]=c;
				k++;
			}
		}
		sort(a,a+j);
		sort(b,b+k);
		double num=sqrt(a[0]*a[1]/b[0]);
		printf("%.0lf\n",num);
		for(i=0;i<j;i++)
		{
			if(i!=0)
				printf(" ");
			printf("%.0lf",a[i]/num);
		}
		printf("\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    8 |         __int64 a[50000],b[50000],c;
      |         ^~~~~~~
      |         __ynf64
a.cc:17:40: error: 'c' was not declared in this scope
   17 |                         scanf("%I64d",&c);
      |                                        ^
a.cc:20:33: error: 'a' was not declared in this scope
   20 |                                 a[j]=c;
      |                                 ^
a.cc:25:33: error: 'b' was not declared in this scope
   25 |                                 b[k]=c;
      |                                 ^
a.cc:29:22: error: 'a' was not declared in this scope
   29 |                 sort(a,a+j);
      |                      ^
a.cc:30:22: error: 'b' was not declared in this scope
   30 |                 sort(b,b+k);
      |                      ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
long long b[50005];
long long a[250];
int n;
long long kgcd( long long a, long long b)
{ 
    if (a == 0) return b; 
    if (b == 0) return a; 
    if (!(a & 1) && !(b & 1)) 
        return kgcd(a>>1, b>>1)<<1;
    else if (!(b & 1))
    return kgcd(a, b>>1); 
    else if (!(a & 1)) return kgcd(a>>1, b); 
    else return kgcd(abs(a - b), a > b ? b : a); 
} 

int main()
{
	int n, i, j;
	long long temp;
	while( cin >> n , n ) {
		for( i = 0 ; i < n * ( n + 1 ) / 2  ; ++ i ) 
			scanf( "%lld" , &b[i] );
		temp = b[0];
		for( i = 1 ; i < n ; i++ ) {
			temp = gcd( temp , b[i] );
		}
		for( j = 0 ; j < n ; ++ j ) {
			a[j] = b[j] / temp;
		}
		if ( a[0] * a[1] == b[n] ) {
			sort( a , a + n );
			printf( "%lld\n" , temp );
			for( j = 0 ; j < n ; ++ j ) {
				if( j != n - 1 )
					printf( "%lld " , a[j] );
				else
					printf(  "%lld\n" , a[j] ); 
			}
		} else {
			for( i = 3 ; i <= ( temp / 2 ); i += 2 ) {
				if( temp % i == 0 ) {
					for( j = 0 ; j < n ; ++ j ) {
						a[j] = b[j] / ( temp / i );
					}
					if ( a[0] * a[1] == b[n] ) {
						sort( a , a + n );
						printf( "%lld\n" , ( temp / i ) );
						for( j = 0 ; j < n ; ++ j ) {
							if( j != n - 1 )
								printf( "%lld " , a[j] );
							else
								printf(  "%lld\n" , a[j] ); 
						}
						break;
					}
				}
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:32: error: 'gcd' was not declared in this scope; did you mean 'kgcd'?
   29 |                         temp = gcd( temp , b[i] );
      |                                ^~~
      |                                kgcd
Language: C++

#include<stdio.h>
#include<algorithm>
using namespace std;
 __int64 n,b[100000],i,j,yu,c[100000],l,o;
int main()
{
	while(scanf("%I64d",&n)!=EOF&&n)
	{
		l=0;
		for(i=0;i<n+n*(n-1)/2;i++)
		{
			scanf("%I64d",&b[i]);
			if(b[i]%2==0)
				c[l++]=b[i];
		}
		sort(c,c+l);
		for(i=2;i<=c[0];i=i+2)
		{
			for(j=0;j<l;j++)
			{
				if(c[j]%i!=0)
					break;
			}
			if(j==l)
				yu=i;
		}	
		printf("%I64d\n",yu);
		for(i=0;i<l-1;i++)
			printf("%I64d ",c[i]/yu);
		printf("%I64d\n",c[l-1]/yu);
	}
	return 0;
}

Compiler output:
a.cc:4:2: error: '__int64' does not name a type; did you mean '__int64_t'?
    4 |  __int64 n,b[100000],i,j,yu,c[100000],l,o;
      |  ^~~~~~~
      |  __int64_t
a.cc: In function 'int main()':
a.cc:7:30: error: 'n' was not declared in this scope
    7 |         while(scanf("%I64d",&n)!=EOF&&n)
      |                              ^
a.cc:9:17: error: 'l' was not declared in this scope
    9 |                 l=0;
      |                 ^
a.cc:10:21: error: 'i' was not declared in this scope
   10 |                 for(i=0;i<n+n*(n-1)/2;i++)
      |                     ^
a.cc:12:40: error: 'b' was not declared in this scope
   12 |                         scanf("%I64d",&b[i]);
      |                                        ^
a.cc:14:33: error: 'c' was not declared in this scope
   14 |                                 c[l++]=b[i];
      |                                 ^
a.cc:16:22: error: 'c' was not declared in this scope
   16 |                 sort(c,c+l);
      |                      ^
a.cc:17:21: error: 'i' was not declared in this scope
   17 |                 for(i=2;i<=c[0];i=i+2)
      |                     ^
a.cc:19:29: error: 'j' was not declared in this scope
   19 |                         for(j=0;j<l;j++)
      |                             ^
a.cc:24:28: error: 'j' was not declared in this scope
   24 |                         if(j==l)
      |                            ^
a.cc:25:33: error: 'yu' was not declared in this scope
   25 |                                 yu=i;
      |                                 ^~
a.cc:27:34: error: 'yu' was not declared in this scope
   27 |                 printf("%I64d\n",yu);
      |                                  ^~
a.cc:28:21: error: 'i' was not declared in this scope
   28 |                 for(i=0;i<l-1;i++)
      |                     ^
Language: C

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int n,m;
    while(scanf("%d%d",&n,&m)!=EOF)
    {
        if(n==0&&m==0) continue;
        printf(((n&1)&&(m&1))?"no\n":"yes\n");
    }
    return 0;
}

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

#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;

int r, c;

void init()
{
    while (scanf("%d%d", &r, &c), r || c)
    {
        if (r == 1 || c == 1) puts("no");
        else puts("yes");
    }
}

int main()
{
    init();
    return 0;
}

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

#include <queue>
#include <vector>
#include <stack>
#include <string>
#include <cstdio>
#include <math.h>
#include <cstdlib>
#include <string.h>
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
#define LL long long
#define PI acos(-1.0)
#define FRE freopen("c:\\users\\nitlian\\desktop\\input.txt","r",stdin)
#define FF freopen("c:\\users\\nitlian\\desktop\\output.txt", "w", stdout)
#define N 510
#define M 100100
#define inf 1000000000
int main() {
	int a, b;
	while (scanf ("%d%d", &a, &b), a+b) {
		if ((a&1) && (b&1) ) puts("no");
		else puts("yes");
	}
}

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

#include<stdio.h>

int main(){

int w,h,n;

while(1){
scanf("%d "d",&h,&w);if(w==0&&h==0)break;

if((w*h)%2==0)printf("yes\n");
else printf("no\n");
}
return 0;
}

Compiler output:
a.cc:8:13: warning: missing terminating " character
    8 | scanf("%d "d",&h,&w);if(w==0&&h==0)break;
      |             ^
a.cc:8:13: error: missing terminating " character
    8 | scanf("%d "d",&h,&w);if(w==0&&h==0)break;
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:7: error: unable to find string literal operator 'operator""d' with 'const char [4]', 'long unsigned int' arguments
    8 | scanf("%d "d",&h,&w);if(w==0&&h==0)break;
      |       ^~~~~~
a.cc:11:1: error: 'else' without a previous 'if'
   11 | else printf("no\n");
      | ^~~~
Language: C++

#include<iostream>
#include<vector>
 
using namespace std;
 
int main(){
 
    int r,c;
 
    while(cin>>r>>c,r,c){
      
        if(r*c%2==0){
            cout<<"yes"<<endl;
        }
        else{
            cout<<"no"<<endl;
        }
    }
}}

Compiler output:
a.cc:19:2: error: expected declaration before '}' token
   19 | }}
      |  ^
Language: C++

import std.stdio;
import std.string, std.conv;
import std.algorithm, std.array;
import std.typecons;

void main() {
  for(;;) {
    auto s = readln.split.map!(to!int).array;
    int N = s[0], M = s[1];
    if(N == 0 && M == 0) break;
    if((N * M) % 2 == 0) writeln("yes");
    else writeln("no");
  }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import std.string, std.conv;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import std.algorithm, std.array;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import std.typecons;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: '::main' must return 'int'
    6 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:14: error: 'readln' was not declared in this scope
    8 |     auto s = readln.split.map!(to!int).array;
      |              ^~~~~~
a.cc:10:18: error: 'M' was not declared in this scope
   10 |     if(N == 0 && M == 0) break;
      |                  ^
a.cc:11:13: error: 'M' was not declared in this scope
   11 |     if((N * M) % 2 == 0) writeln("yes");
      |             ^
a.cc:11:26: error: 'writeln' was not declared in this scope
   11 |     if((N * M) % 2 == 0) writeln("yes");
      |                          ^~~~~~~
a.cc:12:10: error: 'writeln' was not declared in this scope
   12 |     else writeln("no");
      |          ^~~~~~~
Language: C++

#include<stdio.h>
main(){
int r,c;
while(1){

}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:2: error: expected '}' at end of input
    6 | }
      |  ^
a.cc:2:7: note: to match this '{'
    2 | main(){
      |       ^
Language: C

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

typedef struct {
	char name[12];
	int disp_num;
	int disp_time[30];
	int points;
} kyara_t;

int kyara_num;
kyara_t kyara[20];

int all_disp_num[30];

int main(void) {
	int i,j;
	int min_id;
	while(1) {
		scanf("%d",&kyara_num);
		if(kyara_num==0)break;
		memset(kyara,0,sizeof(kyara));
		memset(all_disp_num,0,sizeof(all_disp_num));
		for(i=0;i<kyara_num;i++) {
			scanf("%s%d",kyara[i].name,&kyara[i].disp_num);
			for(j=0;j<kyara[i].disp_num;j++) {
				scanf("%d",&kyara[i].disp_time[j]);
			}
		}
		for(i=0;i<kyara_num;i++) {
			for(j=0;j<kyara[i].disp_num;j++) {
				kyara[i].points+=kyara_num;
				all_disp_num[kyara[i].disp_time[j]]++;
			}
		}
		for(i=0;i<kyara_num;i++) {
			for(j=0;j<kyara[i].disp_num;j++) {
				kyara[i].points-=all_disp_num[kyara[i].disp_time[j]]-1;
			}
		}
		for(i=1,min_id=0;i<kyara_num;i++) {
			if(kyara[i].points<kyara[min_id].points) {
				min_id=i;
			} else if(kyara[i].points==kyara[min_id].points) {
				if(strcmpi(kyara[i].name,kyara[min_id].name)>0) {
					min_id=i;
				}
			}
		}
		printf("%d %s\n",kyara[min_id].points,kyara[min_id].name);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:45:36: error: implicit declaration of function 'strcmpi'; did you mean 'strcmp'? [-Wimplicit-function-declaration]
   45 |                                 if(strcmpi(kyara[i].name,kyara[min_id].name)>0) {
      |                                    ^~~~~~~
      |                                    strcmp
Language: C++

#error "AAA"
#include <cstdio>
#include <cassert>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <string>
#include <stdexcept>

// using Tsurai()=std::out_of_range;
struct Tsurai: public std::out_of_range {
  Tsurai(): std::out_of_range("") {}
};

void apply(int &lhs, char op, int rhs) {
  switch (op) {
  case '+':
    lhs += rhs;
    break;
  case '-':
    lhs -= rhs;
    break;
  case '*':
    lhs *= rhs;
    break;
  }
  if (!(0 <= lhs && lhs < 1024))
    throw Tsurai();
}

int parse_bin(const std::string &s, size_t &i) {
  int res=0;
  while (i < s.length()) {
    res = res*10+s[i]-'0';
    ++i;
    if (res >= 1024) throw Tsurai();
  }
  assert(res < 1024);
  return res;
}

int parse(
    const std::string &s, size_t &i,
    const std::vector<std::string> &ops={"+-", "*", ""}, size_t prec=0) {

  if (prec == ops.size()) {
    if (s.at(i) == '(') {
      ++i;
      if (s.at(i) == ')') throw Tsurai();
      size_t j=i;
      (void)parse_bin(s, j);
      if (s.at(j) == ')') throw Tsurai();

      int res=parse(s, i, ops, 0);
      ++i;
      if (s.at(i) != ')')
        throw Tsurai();
      return res;
    }
    if (isdigit(s.at(i))) {
      return parse_bin(s, i);
    }
    throw Tsurai();
  }

  int lhs=parse(s, i, ops, ++prec);
  while (true) {
    char op=s.at(i);
    if (!(op == '+' || op == '-' || op == '*' || op == ')'))
      throw Tsurai();

    if (!std::count(ops[prec].begin(), ops[prec].end(), op))
      break;

    int rhs=parse(s, ++i, ops, prec+1);
    apply(lhs, op, rhs);
  }
  return lhs;
}

int rec(std::string &s, std::vector<size_t> &dot) {
  if (dot.empty()) {
    try {
      size_t i=0;
      return parse(s, i);
    } catch (Tsurai) {
      return -1;
    }
  }

  size_t x=dot.back();
  dot.pop_back();
  int res=-1;
  for (char ch: {'0', '1', '+', '-', '*', '(', ')'}) {
    s[x] = ch;
    res = std::max(res, rec(s, dot));
  }
  s[x] = '.';
  dot.push_back(x);
  return res;
}

int main() {
  char buf[128];
  scanf("%s", buf);
  std::string s=buf;
  std::vector<size_t> dot;
  for (size_t i=0; i<s.length(); ++i) {
    if (s[i] == '.')
      dot.push_back(i);
  }

  printf("%d\n", rec(s, dot));
}



Compiler output:
a.cc:1:2: error: #error "AAA"
    1 | #error "AAA"
      |  ^~~~~
Language: C++

#error "A"
#include <cstdio>
#include <cassert>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <string>
#include <stdexcept>

//#define fprintf(...) void(0)
struct Tsurai: public std::out_of_range {
  Tsurai(int d): std::out_of_range(std::string("L: ")+std::to_string(d)) {}
};

void apply(int &lhs, char op, int rhs) {
  switch (op) {
  case '+':
    lhs += rhs;
    break;
  case '-':
    lhs -= rhs;
    break;
  case '*':
    lhs *= rhs;
    break;
  }
  if (!(0 <= lhs && lhs < 1024))
    throw Tsurai(__LINE__);
}

int parse_bin(const std::string &s, size_t &i) {
  int res=0;
  while (i < s.length()) {
    res = res*2+s[i]-'0';
    ++i;
    if (res >= 1024) throw Tsurai(__LINE__);
  }
  assert(res < 1024);
  return res;
}

int parse(
    const std::string &s, size_t &i,
    const std::vector<std::string> &ops={"+-", "*", ""}, size_t prec=0) {

  fprintf(stderr, "C%zu\n", i);
  fprintf(stderr, "S: %s\n", s.c_str());
  if (prec == ops.size()) {
    if (s.at(i) == '(') {
      ++i;
      if (s.at(i) == ')') throw Tsurai(__LINE__);
      size_t j=i;
      (void)parse_bin(s, j);
      if (s.at(j) == ')') throw Tsurai(__LINE__);

      int res=parse(s, i, ops, 0);
      if (s.at(i) != ')')
        throw Tsurai(__LINE__);
      ++i;
      return res;
    }
    fprintf(stderr, "%d\n", __LINE__);
    if (isdigit(s.at(i))) {
      fprintf(stderr, "%d\n", __LINE__);
      return parse_bin(s, i);
    }
    throw Tsurai(__LINE__);
  }

  int lhs=parse(s, i, ops, prec+1);
  while (i < s.length()) {
    char op=s.at(i);
    if (!(op == '+' || op == '-' || op == '*'))
      throw Tsurai(__LINE__);

    if (!std::count(ops[prec].begin(), ops[prec].end(), op))
      break;

    int rhs=parse(s, ++i, ops, prec+1);
    apply(lhs, op, rhs);
  }
  return lhs;
}

int rec(std::string &s, std::vector<size_t> &dot) {
  if (dot.empty()) {
    try {
      size_t i=0;
      return parse(s, i);
      if (i != s.length()) return -1;
    } catch (std::out_of_range x) {
      fprintf(stderr, "Tsurai on %s\n", x.what());
      return -1;
    }
  }

  size_t x=dot.back();
  dot.pop_back();
  int res=-1;
  for (char ch: {'0', '1', '+', '-', '*', '(', ')'}) {
    s[x] = ch;
    res = std::max(res, rec(s, dot));
  }
  s[x] = '.';
  dot.push_back(x);
  return res;
}

int main() {
  char buf[128];
  scanf("%s", buf);
  std::string s=buf;
  std::vector<size_t> dot;
  for (size_t i=0; i<s.length(); ++i) {
    if (s[i] == '.')
      dot.push_back(i);
  }

  printf("%d\n", rec(s, dot));
}



Compiler output:
a.cc:1:2: error: #error "A"
    1 | #error "A"
      |  ^~~~~
Language: C++

     a[3]=="#..-..#" &&
     a[4]=="#.|.|.#" &&
     a[5]=="#..-..#") return 6;

  if(a[3]=="#.....#" &&
     a[5]=="#.....#") return 7;

  if(a[1]=="#..-..#" && 
     a[2]=="#.|.|.#" &&
     a[3]=="#..-..#" &&
     a[4]=="#.|.|.#" &&
     a[5]=="#..-..#") return 8;

  if(a[1]=="#..-..#" && 
     a[2]=="#.|.|.#" &&
     a[3]=="#..-..#" &&
     a[4]=="#...|.#" &&
     a[5]=="#..-..#") return 9;
  return -1;
}

Compiler output:
a.cc:1:6: error: 'a' does not name a type
    1 |      a[3]=="#..-..#" &&
      |      ^
a.cc:5:3: error: expected unqualified-id before 'if'
    5 |   if(a[3]=="#.....#" &&
      |   ^~
a.cc:8:3: error: expected unqualified-id before 'if'
    8 |   if(a[1]=="#..-..#" &&
      |   ^~
a.cc:14:3: error: expected unqualified-id before 'if'
   14 |   if(a[1]=="#..-..#" &&
      |   ^~
a.cc:19:3: error: expected unqualified-id before 'return'
   19 |   return -1;
      |   ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_M=100000;
int a[MAX_M];

ll gcd(ll a,ll b){
    if(b==0)return a;
    return gcd(b,a%b);
}

pair<ll,ll> InclusionExclusion(ll n,ll m){
    // a1,a2,..Ì¤¿A­È­ÆàPÂÅèØêéàÌÌa
    ll sum=0;
    // ­È­ÆàPÂÅèØêéàÌÌÂ
    ll res=0;
    for(int i=1;i<(1<<m);i++){
        ll num=0;
        for(ll j = i;j!=0;j>>=1)
            num+=j&1;
        ll lcm=1;
        for(int j = 0; j <m; j++){
            if((i>>j)&1){
                lcm=lcm/gcd(lcm,a[j])*a[j];
                if(lcm>n)
                    break;
            }
        }
        if(num%2==0){
            int t=n/lcm;
            sum-=lcm*t*(t+1)/2;
            res-=n/lcm;
        }
        else{
            res+=n/lcm;
            ll t=n/lcm;
            sum+=lcm*t*(t+1)/2;
        }
    }
    sum=n*(n+1)/2-sum;
    res=n-res;
    return make_pair(res,sum);
}

void solve(){
    ll n,m;
    while(cin>>n>>m&&!(n==0&&m==0)){
        for(int i = 0; i < m; i++)
            cin>>a[i];
        pair<ll,ll> p=InclusionExclusion(n,m);
        if(p.first==0){
            p.second=0;p.first=1;
        }
        printf("%.7f\n",(double)p.second/p.first);
    }
}

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
Language: C++

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

int main()
{
  long long int n, m;
  while (cin >> n >> m) {
    if ((n|m) == 0)
      break;

    vector<long long int> p(m);
    for (int i = 0; i < m; ++i)
      cin >> p[i];

    long long int sum = (n+1) * n / 2, cnt = n;
    for (int i = 1; i < (1 << m); ++i) {
      long long int lcm = 1LL;
      for (int j = 0; j < m; ++j) {
	if (i & (1 << j))
	  lcm = lcm / __gcd(lcm, p[j]) * p[j];
      }
      if (__builtin_popcount(i) & 1) {
	sum -= lcm * ((n/lcm+1) * n/lcm / 2);
	cnt -= n / lcm;
      } else {
	sum += lcm * ((n/lcm+1) * n/lcm / 2);
	cnt += n / lcm;
      }
    }

    if (cnt == 0)
      printf("%.10f\n", 0.0);
    else
      printf("%.10f\n", sum / (cnt * 1.0));
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: '__gcd' was not declared in this scope
   22 |           lcm = lcm / __gcd(lcm, p[j]) * p[j];
      |                       ^~~~~