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

double P[102][101];
char L[101],B[101];
main(){
	int N,T,l,b,x,t,n,k;
	for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
		memset(P,0,sizeof(P));
		memset(L,0,sizeof(L)+sizeof(B));
		for(;l--;)scanf("%d",&x),L[x]=1;
		for(;b--;)scanf("%d",&x),B[x]=1;
		for(P[t=0][0]=1;;t<T;P[t+1][N]+=P[t][N],t++)for(n=0;n<N;n++){
			for(k=1;k<=6;k++){
				x=n+k;
				if(x>N)x=2*N-x;
				if(B[x])x=0;
				P[t+1+L[x]][x]+=P[t][n]/6;
			}
		}
		printf("%f\n",P[T][N]);
	}
exit(0);}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:14: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |         for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
      |              ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | double P[102][101];
main.c:5:14: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |         for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
      |              ^~~~~
main.c:5:14: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:17: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
    6 |                 memset(P,0,sizeof(P));
      |                 ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset'
  +++ |+#include <string.h>
    1 | double P[102][101];
main.c:6:17: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
    6 |                 memset(P,0,sizeof(P));
      |                 ^~~~~~
main.c:6:17: note: include '<string.h>' or provide a declaration of 'memset'
main.c:10:37: error: expected ')' before ';' token
   10 |                 for(P[t=0][0]=1;;t<T;P[t+1][N]+=P[t][N],t++)for(n=0;n<N;n++){
      |                    ~                ^
      |                                     )
main.c:18:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |                 printf("%f\n",P[T][N]);
      |                 ^~~~~~
main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:1: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   20 | exit(0);}
      | ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | double P[102][101];
main.c:20:1: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   20 | exit(0);}
      | ^~~~
main.c:20:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
Language: C

double P[102][101];
char L[101],B[101];
main(){
	int N,T,l,b,x,t,n,k;
	for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
		memset(P,0,sizeof(P));
		memset(L,0,sizeof(L));
		memset(B,0,sizeof(B));
		for(;l--;)scanf("%d",&x),L[x]=1;
		for(;b--;)scanf("%d",&x),B[x]=1;
		for(P[t=0][0]=1;;t<T;P[t+1][N]+=P[t][N],t++)for(n=0;n<N;n++){
			for(k=1;k<=6;k++){
				x=n+k;
				if(x>N)x=2*N-x;
				if(B[x])x=0;
				P[t+1+L[x]][x]+=P[t][n]/6;
			}
		}
		printf("%f\n",P[T][N]);
	}
exit(0);}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:14: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |         for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
      |              ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | double P[102][101];
main.c:5:14: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |         for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
      |              ^~~~~
main.c:5:14: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:17: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
    6 |                 memset(P,0,sizeof(P));
      |                 ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset'
  +++ |+#include <string.h>
    1 | double P[102][101];
main.c:6:17: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
    6 |                 memset(P,0,sizeof(P));
      |                 ^~~~~~
main.c:6:17: note: include '<string.h>' or provide a declaration of 'memset'
main.c:11:37: error: expected ')' before ';' token
   11 |                 for(P[t=0][0]=1;;t<T;P[t+1][N]+=P[t][N],t++)for(n=0;n<N;n++){
      |                    ~                ^
      |                                     )
main.c:19:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   19 |                 printf("%f\n",P[T][N]);
      |                 ^~~~~~
main.c:19:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:19:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:1: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   21 | exit(0);}
      | ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | double P[102][101];
main.c:21:1: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   21 | exit(0);}
      | ^~~~
main.c:21:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
Language: C

#include <cstdio>
double P[102][101];
char L[101],B[101];
int main(){
	int N,T,l,b,x,t,n,k;
	for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
		memset(P,0,sizeof(P));
		memset(L,0,sizeof(L));
		memset(B,0,sizeof(B));
		for(;l--;)scanf("%d",&x),L[x]=1;
		for(;b--;)scanf("%d",&x),B[x]=1;
		for(P[t=0][0]=1;t<T;P[t+1][N]+=P[t][N],t++)for(n=0;n<N;n++){
			for(k=1;k<=6;k++){
				x=n+k;
				if(x>N)x=2*N-x;
				if(B[x])x=0;
				P[t+1+L[x]][x]+=P[t][n]/6;
			}
		}
		printf("%f\n",P[T][N]);
	}
}

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

#include<iostream>
using namespace std;

int board[101];
double prob[101];

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<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
#define SZ(n)  (int)n.size()
#define dump(x) cerr<<#x<<" = "<<(x)<<endl;
#define debug(x)cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define MP make_pair
#define PB push_back
const int INF=1<<28;
	int ta[10000];
	double dp[120][120];//i繧ソ繝シ繝ウ逶ョ縺ォ,繝槭せj縺ォ縺?ｋ繝代ち繝シ繝ウ縺ョ蜷郁ィ?	bool bre[120][120];
	int main(){
	int n,t,l,b;
	cin>>n>>t>>l>>b;
	for(int i=0;i<l;i++){int a;cin>>a;ta[a]=1;}
	for(int i=0;i<b;i++){int a;cin>>a;ta[a]=2;}
	dp[0][0]=1;
	for(int i=0;i<t;i++){
		for(int j=0;j<n;j++){
			if(bre[i][j]==1){dp[i+1][j]+=dp[i][j]*(1.0/6.0);continue;}
			for(int k=1;k<=6;k++){
				int next=j+k;
				if(next>n)next=n-(j+k-n);
				if(ta[next]==2)dp[i+1][0]+=dp[i][j]*(1.0/6.0);
				else dp[i+1][next]+=dp[i][j]*(1.0/6.0);
				if(ta[next]==1)bre[i+1][next]=1;
			}
			
		}
	}

	double ans=0.0;
	/*for(int i=0;i<=t;i++)ans+=dp[i][n];
	for(int i=0;i<=t;i++){
		for(int j=0;j<=n;j++)printf("%.3lf  ",dp[i][j]);
		cout<<endl;
	}*/
	printf("%.6lf\n",ans);
	//int kaku=0;
	//for(int i=0;i<=n;i++)kaku+=dp[t][i];
	//cout<<(double)dp[t][n]/(double)kaku<<endl;
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:30:28: error: 'bre' was not declared in this scope
   30 |                         if(bre[i][j]==1){dp[i+1][j]+=dp[i][j]*(1.0/6.0);continue;}
      |                            ^~~
a.cc:36:48: error: 'bre' was not declared in this scope
   36 |                                 if(ta[next]==1)bre[i+1][next]=1;
      |                                                ^~~
Language: C++

#include<iostream>
using namespace std;

int main(int argc, char *argv[]){
  int n, t, l, b, skip = 1, back = 2;
  while(cin >> n >> t >> l >> b, n){
    n++;
    int measure[n];
    double probably[2][n];
    double for_skip[n];
    memset(measure, 0, sizeof(measure));
    memset(for_skip, 0, sizeof(for_skip));
    memset(probably, 0, sizeof(probably));
    probably[0][0] = 1;
    int tmp;
    for (int i = 0; i < l; i++) {
      cin >> tmp;
      measure[tmp] = skip;
    }
    for (int i = 0; i < b; i++) {
      cin >> tmp;
      measure[tmp] = back;
    }
    for (int i = 0; i < t; i++) {
      for (int j = 0; j < n - 1; j++) {
        for (int k = 1; k < 7; k++) {
          int pos = j + k;
          if(pos > n - 1){
            pos = 2*(n - 1) - pos;
          }
          if(measure[pos] == 0){
            probably[(i+1)&1][pos] += probably[i&1][j]/6;
          }else if(measure[pos] == back){
            probably[(i+1)&1][0] += probably[i&1][j]/6;
          }else{
            for_skip[pos] += probably[i&1][j]/6;
          }
        }
      }
      probably[(i+1)&1][n - 1] += probably[i&1][n - 1];
      for (int j = 0; j < n; j++) {
        probably[i&1][j] = for_skip[j];
        for_skip[j] = 0;
      }
    }
    // for (int i = 0; i < n; i++) {
    //   std::cout << probably[0][i] << " ";
    // }
    // std::cout << std::endl;
    // for (int i = 0; i < n; i++) {
    //   std::cout << probably[1][i] << " ";
    // }
    // std::cout << std::endl;
    // double a = 0;
    // for (int i = 0; i < 2; i++) {
    //   for (int j = 0; j < n; j++) {
    //     a += probably[i][j];
    //   }
    // }
    // for (int i = 0; i < n; i++) {
    //   a += for_skip[i];
    // }

    // std::cout << "sum:" << a << std::endl;
    printf("%.6lf\n", probably[t&1][n - 1]);
  }
  return 0;
}

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

// Aoj_1277.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include<iostream>
using namespace std;
int map[100 + 1];
double dp[100 + 1][100 + 1];
int N,T,L,B;

int main()
{
	int lose;
	int back;
	while (cin >> N >> T >> L >> B && N != 0 || T != 0 || L != 0 || B != 0)
	{
		for (int i = 0; i < L; i++)
		{
			cin >> lose;
			map[lose] = 'L';
		}

		for (int i = 0; i < B; i++)
		{
			cin >> back;
			map[back] = 'B';
		}
		for (int i = 0; i < 101; i++)
		{
			for (int j = 0; j < 101; j++)
			{
				dp[i][j] = 0;
			}
		}
		dp[0][0] = 1.0;
		for (int t = 0; t < T; t++)
		{
			for (int now = 0; now < N; now++)
			{
				for (int i = 1; i <= 6; i++)
				{
					int next = now + i;
					if (next > N)next = N - (next - N);
					if (map[next] == 'B')
					{
						dp[t + 1][0] += dp[t][now] * 1.0 / 6.0;
					}
					else if (map[next] == 'L')
					{
						if(t + 2 <= T)dp[t + 2][next] += dp[t][now] * 1.0 / 6.0;
					}
					else
					{
						dp[t + 1][next] += dp[t][now] * 1.0 / 6.0;
					}
				}
			}
		}
		double ans = 0.0;
		for (int i = 0; i <= T; i++)
		{
			ans += dp[i][N];
		}
		printf("%.6f\n",ans);
	}
	return 0;
}

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

#include <iostream>
#include <cstdio>

const float kProbability = 1.0f / 6.0f;
const int kMaxSquare = 101;
const int kMaxTurn = 101s;

enum BoardState{
	BLANK, LOSE, BACK
};

BoardState board[kMaxSquare];

float bp(const int N, const int T){
	float prob[kMaxTurn][kMaxSquare];
	for (int i = 0; i <= T; i++)
		for (int j = 0; j <= N; j++)
			prob[i][j] = 0.0f;
	prob[0][0] = 1.0f;

	for (int t = 0; t < T; t++){
		for (int n = 0; n < N; n++){
			if (prob[t][n] == 0.0f) continue;
			for (int dice = 1; dice <= 6; dice++){
				int pos = (n + dice <= N) ? n + dice : N - (n + dice - N);
				switch (board[pos]){
				case BLANK:
					prob[t + 1][pos] += prob[t][n] * kProbability;
					break;
				case LOSE:
					prob[t + 2][pos] += prob[t][n] * kProbability;
					break;
				case BACK:
					prob[t + 1][0] += prob[t][n] * kProbability;
				}
			}
		}
	}

	float res = 0.0f;
	for (int i = 1; i <= T; i++)
		res += prob[i][N];
	return res;
}

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

	while (1){
		int N, T, L, B;
		std::cin >> N >> T >> L >> B;
		if (N == 0) break;
		for (int i = 0; i <= N; i++) board[i] = BLANK;
		for (int i = 0; i < L; i++){
			int l;
			std::cin >> l;
			board[l] = LOSE;
		}
		for (int i = 0; i < B; i++){
			int b;
			std::cin >> b;
			board[b] = BACK;
		}

		printf("%.6f\n", bp(N, T));
	}

	return 0;
}

Compiler output:
a.cc:6:22: error: unable to find numeric literal operator 'operator""s'
    6 | const int kMaxTurn = 101s;
      |                      ^~~~
a.cc: In function 'float bp(int, int)':
a.cc:15:20: error: size of array 'prob' is not an integral constant-expression
   15 |         float prob[kMaxTurn][kMaxSquare];
      |                    ^~~~~~~~
Language: C++

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

int main(){
  int N, T, L, B;
  while(cin >> N >> T >> L >> B && N>0){
    bool lose[100], back[100];
    int index;
    
    for(int i=0;i<L;i++){
      cin >> index;
      lose[index]=true;
    }
    for(int i=0;i<B;i++){
      cin >> index;
      back[index]=true;
    }

    double p[101][101];
    for(int i=1;i<=L;i++){
      p[i][0]=0.0;
      p[i][1]=(i<=6)?(1.0/6.0):0.0;
    }

    for(int tn=2;tn<=T;tn++){
      for(int lg=1;lg<=L;lg++){
	double pr=0.0;
	for(int i=1;i<=6;i++){
	  int to=abs(lg-i);
	  if(to==0)
	    pr+=1.0;
	  else if(back[L-to])
	    pr+=p[L][tr-1];
	  else if(lose[L-to])
	    pr+=p[to][tr-2];
	  else
	    pr+=p[to][tr-1];
	}
	p[lg][tr]=pr/6.0;
      }
    }
    cout << p[L][T] << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:22: error: 'tr' was not declared in this scope; did you mean 'to'?
   34 |             pr+=p[L][tr-1];
      |                      ^~
      |                      to
a.cc:36:23: error: 'tr' was not declared in this scope; did you mean 'to'?
   36 |             pr+=p[to][tr-2];
      |                       ^~
      |                       to
a.cc:38:23: error: 'tr' was not declared in this scope; did you mean 'to'?
   38 |             pr+=p[to][tr-1];
      |                       ^~
      |                       to
a.cc:40:15: error: 'tr' was not declared in this scope; did you mean 'pr'?
   40 |         p[lg][tr]=pr/6.0;
      |               ^~
      |               pr
Language: C++

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

int main(){
  int N, T, L, B;
  while(cin >> N >> T >> L >> B && N>0){
    bool lose[100], back[100];
    int index;
    
    for(int i=0;i<L;i++){
      cin >> index;
      lose[index]=true;
    }
    for(int i=0;i<B;i++){
      cin >> index;
      back[index]=true;
    }

    double p[101][101];
    for(int i=1;i<=L;i++){
      p[i][0]=0.0;
      p[i][1]=(i<=6)?(1.0/6.0):0.0;
    }

    for(int tn=2;tn<=T;tn++){
      for(int lg=1;lg<=L;lg++){
	double pr=0.0;
	for(int i=1;i<=6;i++){
	  int to=abs(lg-i);
	  if(to==0)
	    pr+=1.0;
	  else if(back[L-to])
	    pr+=p[L][tn-1];
	  else if(lose[L-to])
	    pr+=p[to][tn-2];
	  else
	    pr+=p[to][tn-1];
	}
	p[lg][tr]=pr/6.0;
      }
    }
    cout << p[L][T] << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:15: error: 'tr' was not declared in this scope; did you mean 'pr'?
   40 |         p[lg][tr]=pr/6.0;
      |               ^~
      |               pr
Language: C++

#include<iostream>
#include<vector>

using namespace std;
typedef vector<int> vi;
typedef vector<char> vc;
double dp[110][110];
int main() {
	while (true) {
		memset(dp, 0, sizeof(dp));
		int n, l, t, b;
		cin >> n >> t >> l >> b;
		if (n == 0 && t == 0 && l == 0 && b == 0) {
			return 0;
		}
		vc A(n + 1, 'n');
		for (int i = 0; i < l; i++) {
			int L;
			cin >> L;
			A[L] = 'l';
		}
		for (int i = 0; i < b; i++) {
			int B;
			cin >> B;
			A[B] = 'b';
		}
		dp[0][0] = 1;
		for (int i = 0; i <= t; i++) {
			for (int j = n - 1; j >= 0; j--) {
				if (A[j] == 'n') {
					for (int k = 1; k <= 6; k++) {
						dp[i + 1][(j + k) <= n ? j + k : 2 * n - j - k] += dp[i][j] / 6;
					}
				}
				else if (A[j] == 'l') {
					for (int k = 1; k <= 6; k++) {
						dp[i + 2][(j + k) <= n ? j + k : 2 * n - j - k] += dp[i][j] / 6;
					}
				}
			}
			for (int j = 0; j <= n; j++) {
				if (A[j] == 'b') {
					dp[i + 1][0] += dp[i + 1][j];
				}
			}
		}
		double ans = 0;
		for (int i = 0; i <= t; i++) {
			ans += dp[i][n];
		}
		//for (int i = 0; i <= t; i++) {
		//	for (int j = 0; j <= n; j++) {
		//		cout << dp[i][j] << " ";
		//	}
		//	cout << endl;	
		//}
		cout << ans << endl;
	}

}

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

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max()/2;
const int MOD = 1e9+7;
const double EX=1.0/6.0;

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

    int n,t,l,b;
    while(cin>>n>>t>>l>>b){
        if(n==0) return 0;
        vector<vector<double>> dp(t+2,vector<double>(n+1,0));
        dp[0][0]=1;
        vector<int> lose(n+1,0),back(n+1,0);
        for(int i=0;i<l;i++){
            int idx;cin>>idx;
            lose[idx]=1;
        }
        for(int i=0;i<b;i++){
            int idx;cin>>idx;
            back[idx]=1;
        }
        for(int i=1;i<=min(n,6);i++){
            if(back[i]) dp[1][0]+=EX;
            else dp[1][i]=EX;
        }
        for(int i=1;i<t;i++){
            for(int j=1;j<n;j++){
                if(back[j]){
                    dp[i][0]+=dp[i][j];
                    dp[i][j]=0;
                }
            }
            for(int j=0;j<n;j++){
                for(int k=1;k<=6;k++){
                    int dst=j+k;
                    if(dst>n){
                        int dif=dst-n;
                        dst=n-dif;
                    }
                    if(back[j]) continue;
                    else if(lose[j]) dp[i+2][dst]+=dp[i][j]*EX;
                    else dp[i+1][dst]+=dp[i][j]*EX;
                }
            }
        }
        double res=0;
        for(int i=1;i<=t;i++) res+=dp[i][n];
        cout<<fixed<<setprecision(10)<<res<<endl;
    }



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

#include <iostream>

using namespace std;

int main(){
	int N, T, L, B;
	while(cin >> N >> T >> L >> B, N){
		bool lose[101], back[101];
		memset(lose, false, sizeof(lose));
		memset(back, false, sizeof(back));
		for(int i=0;i<L;i++){
			int idx; cin >> idx; lose[idx] = true;
		}
		for(int i=0;i<B;i++){
			int idx; cin >> idx; back[idx] = true;
		}
		double dp[102][101];
		for(int i=0;i<=T;i++)
			for(int j=0;j<=N;j++) dp[i][j] = 0.0;
		dp[0][0] = 1.0;
		for(int i=0;i<T;i++){
			for(int j=0;j<N;j++){
				for(int k=1;k<=6;k++){
					int pos = j+k<=N ? j+k : N-(j+k-N);
					if(back[pos]) pos = 0;
					dp[i+1+lose[pos]][pos] += dp[i][j]/6;
				}
			}
		}
		double res = 0.0;
		for(int i=1;i<=T;i++) res += dp[i][N];
		printf("%.8lf\n", res);
	}
}

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

#include <cstdio>
double P[102][101];
char L[101],B[101];
int main(){
	int N,T,l,b,x,t,n,k;
	for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
		memset(P,0,sizeof(P));
		memset(L,0,sizeof(L));
		memset(B,0,sizeof(B));
		for(;l--;)scanf("%d",&x),L[x]=1;
		for(;b--;)scanf("%d",&x),B[x]=1;
		for(P[t=0][0]=1;t<T;P[t+1][N]+=P[t][N],t++)for(n=0;n<N;n++){
			for(k=1;k<=6;k++){
				x=n+k;
				if(x>N)x=2*N-x;
				if(B[x])x=0;
				P[t+1+L[x]][x]+=P[t][n]/6;
			}
		}
		printf("%f\n",P[T][N]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'memset' was not declared in this scope
    7 |                 memset(P,0,sizeof(P));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <cstdio>
  +++ |+#include <cstring>
    2 | double P[102][101];
Language: Java

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.PriorityQueue;

public class AOJ {

	public static void main(String[] args) {
		while (true) {
			int N = nextInt();
			if (N == 0) {
				break;
			}
			int M = nextInt();
			ArrayList<Edge> list = new ArrayList<Edge>();

			for (int i = 0; i < M; i++) {
				int a = nextInt() - 1;
				int b = nextInt() - 1;
				int w = nextInt();
				list.add(new Edge(w, a, b));
			}
			Collections.sort(list);

			int ans = Integer.MAX_VALUE;
			for (int i = 0; i < list.size(); i++) {
				// 道iのコストより大きい物だけを使って最小全域木を作ってみる
				if (i > 0 && list.get(i).weight == list.get(i - 1).weight) {
					// もう調べたコストならスルー
					continue;
				}

				PriorityQueue<Edge> priorityQueue = new PriorityQueue<Edge>();
				for (int j = i; j < list.size(); j++) {
					priorityQueue.add(new Edge(list.get(j).weight, list.get(j).from, list.get(j).to));
				}

				UnionFind uf = new UnionFind(N);
				int max = 0;// 最大コストを調べておく
				while (!priorityQueue.isEmpty()) {
					Edge e = priorityQueue.poll();
					if (!uf.isSame(e.from, e.to)) {
						max = Math.max(max, e.weight);
						uf.unite(e.from, e.to);
					}
				}

				// 全域木になっているかチェック
				boolean allSame = true;
				for (int j = 1; j < N; j++) {
					if (!uf.isSame(0, j)) {
						allSame = false;
						break;
					}
				}

				// 全域木なら解答を更新
				if (allSame) {
					ans = Math.min(ans, max - list.get(i).weight);
				} else {
					break;
				}
			}

			if (ans == Integer.MAX_VALUE) {
				System.out.println(-1);
			} else {
				System.out.println(ans);
			}
		}
	}

	static int nextInt() {
		int c;
		try {
			c = System.in.read();
			while (c != '-' && (c < '0' || c > '9'))
				c = System.in.read();
			if (c == '-')
				return -nextInt();
			int res = 0;
			while (c >= '0' && c <= '9') {
				res = res * 10 + c - '0';
				c = System.in.read();
			}
			return res;
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return -1;
	}
}

class UnionFind {
	int[] parts;

	UnionFind(int n) {
		parts = new int[n];
		for (int i = 0; i < n; i++)
			parts[i] = i;
	}

	public int find(int x) {
		if (parts[x] == x)
			return x;
		return parts[x] = find(parts[x]);
	}

	public Boolean isSame(int x, int y) {
		return find(x) == find(y);
	}

	public void unite(int x, int y) {
		if (find(x) == find(y))
			return;
		parts[find(x)] = find(y);
	}
}

class Edge implements Comparable<Edge> {
	int weight;
	int from, to;

	Edge(int w, int f, int t) {
		this.weight = w;
		this.from = f;
		this.to = t;
	}

	@Override
	public int compareTo(Edge edge) {
		// 昇順
		return this.weight - edge.weight;
	}
}

Compiler output:
Main.java:6: error: class AOJ is public, should be declared in a file named AOJ.java
public class AOJ {
       ^
1 error
Language: C

#include<stdio.h>
#define MAX_N 150
#define INF 10e8
typedef struct {
	int a;
	int b;
	int w;
} hen;

int par[MAX_N];
int rank[MAX_N];
int n,m;
hen dis[20000];

void init(int n){
	int i;
	for(i=0;i<n;i++){
		par[i] = i;
		rank[i] = 0;
	}
}
int find(int x){
	if(par[x]==x){
		return x;
	}else {
		return par[x] = find(par[x]);
	}
}
void unite(int x,int y){
	x =find(x);
	y =find(y);
	if(x==y){
		return ;
	}
	if(rank[x] < rank[y]){
		par[x] = y;
	}else {
		par[y] = x;
		if(rank[x] == rank[y])rank[x]++;
	}
}
int same(int x,int y){
	return find(x)==find(y);
}
int  judge(hen *a,hen *b){
	return (a->w)-(b->w);
}

int Kruskal(int start){
	int eda=0;
	int i,j,k;
	int max=0;
	int min = dis[start].w;
	init(110);
	for(i=start;i<m;i++){
		hen h = dis[i];
		if(!same(h.a,h.b)){
			eda++;
			unite(h.a,h.b);
			max = h.w;
		}
	}
	
	for(i=1;i<n+1;i++){
	//	printf("%d ",find(i));
		if(!same(1,i)){
			return -1;
		}
	}
	if(eda==n-1){
		return max-min;
	}eles {
		return INF
	}
}
int main(){
	int i,j,k;
	int ans=INF;
	int buf=0;
	while(scanf("%d %d",&n,&m)){
		if(n==0&&m==0){
			break;
		}
		for(i=0;i<m;i++){
			scanf("%d %d %d",&dis[i].a,&dis[i].b,&dis[i].w);
		}
		ans=10e8;
		qsort(dis,m,sizeof(hen),judge);
		for(i=0;i<m;i++){
			buf = Kruskal(i);
			if(buf!=-1&&buf<ans){
				ans =buf;
			}
		}
		if(ans==INF){
			printf("%d\n",-1);
		}else {
			printf("%d\n",ans);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'Kruskal':
main.c:72:10: error: 'eles' undeclared (first use in this function)
   72 |         }eles {
      |          ^~~~
main.c:72:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:72:14: error: expected ';' before '{' token
   72 |         }eles {
      |              ^~
      |              ;
main.c: In function 'main':
main.c:88:17: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   88 |                 qsort(dis,m,sizeof(hen),judge);
      |                 ^~~~~
Language: C

#include<stdio.h>
#define MAX_N 150
#define INF 10e8
typedef struct {
	int a;
	int b;
	int w;
} hen;

int par[MAX_N];
int rank[MAX_N];
int n,m;
hen dis[20000];

void init(int n){
	int i;
	for(i=0;i<n;i++){
		par[i] = i;
		rank[i] = 0;
	}
}
int find(int x){
	if(par[x]==x){
		return x;
	}else {
		return par[x] = find(par[x]);
	}
}
void unite(int x,int y){
	x =find(x);
	y =find(y);
	if(x==y){
		return ;
	}
	if(rank[x] < rank[y]){
		par[x] = y;
	}else {
		par[y] = x;
		if(rank[x] == rank[y])rank[x]++;
	}
}
int same(int x,int y){
	return find(x)==find(y);
}
int  judge(hen *a,hen *b){
	return (a->w)-(b->w);
}

int Kruskal(int start){
	int eda=0;
	int i,j,k;
	int max=0;
	int min = dis[start].w;
	init(110);
	for(i=start;i<m;i++){
		hen h = dis[i];
		if(!same(h.a,h.b)){
			eda++;
			unite(h.a,h.b);
			max = h.w;
		}
	}
	
	for(i=1;i<n+1;i++){
	//	printf("%d ",find(i));
		if(!same(1,i)){
			return -1;
		}
	}
	if(eda==n-1){
		return max-min;
	}eles {
		return INF;
	}
}
int main(){
	int i,j,k;
	int ans=INF;
	int buf=0;
	while(scanf("%d %d",&n,&m)){
		if(n==0&&m==0){
			break;
		}
		for(i=0;i<m;i++){
			scanf("%d %d %d",&dis[i].a,&dis[i].b,&dis[i].w);
		}
		ans=10e8;
		qsort(dis,m,sizeof(hen),judge);
		for(i=0;i<m;i++){
			buf = Kruskal(i);
			if(buf!=-1&&buf<ans){
				ans =buf;
			}
		}
		if(ans==INF){
			printf("%d\n",-1);
		}else {
			printf("%d\n",ans);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'Kruskal':
main.c:72:10: error: 'eles' undeclared (first use in this function)
   72 |         }eles {
      |          ^~~~
main.c:72:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:72:14: error: expected ';' before '{' token
   72 |         }eles {
      |              ^~
      |              ;
main.c: In function 'main':
main.c:88:17: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   88 |                 qsort(dis,m,sizeof(hen),judge);
      |                 ^~~~~
Language: C++

4 5
1 2 3
1 3 5
1 4 6
2 4 6
3 4 7
4 6
1 2 10
1 3 100
1 4 90
2 3 20
2 4 80
3 4 40
2 1
1 2 1
3 0
3 1
1 2 1
3 3
1 2 2
2 3 5
1 3 6
5 10
1 2 110
1 3 120
1 4 130
1 5 120
2 3 110
2 4 120
2 5 130
3 4 120
3 5 110
4 5 120
5 10
1 2 9384
1 3 887
1 4 2778
1 5 6916
2 3 7794
2 4 8336
2 5 5387
3 4 493
3 5 6650
4 5 1422
5 8
1 2 1
2 3 100
3 4 100
4 5 100
1 5 50
2 5 50
3 5 50
4 1 150
0 0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 4 5
      | ^
Language: C++

#include <cstdio>
#include <cstring>
#include <cctype>
using namespace std;

unsigned short vis[1 << 24];
char c[16][20];
bool wall[256];
int tm0;
vector<int> q[2];

bool check(int u, int v){
	for(int i = 0; i < 24; i += 8){
		int p1 = v >> i & 255;
		if(p1){
			int j = (i + 8) % 24;
			if(wall[p1]){ return false; }
			int p2 = (v >> j % 24) & 255;
			if(p1 == p2){ return false; }
			if(
				p1 == (u >> j % 24 & 255) &&
				p2 == (u >> i % 24 & 255)
			){
				return false;
			}
		}
	}
	return true;
}

int solve(int start, int goal){
	const int dif[5] = {0, -1, 1, -16, 16};

	q[0].clear();
	q[1].clear();
	q[0].push_back(start);

	int tm = tm0 + 1;
	vis[start] = tm;
	while(1){
		if(q[0].empty()){
			q[0].swap(q[1]);
			++tm;
		}
		else{
			int u = q[0].back();
			q[0].pop_back();
			for(int i1 = u & 255 ? 4 : 0; i1 >= 0; --i1)
			for(int i2 = u >> 8 & 255 ? 4 : 0; i2 >= 0; --i2)
			for(int i3 = u >> 16 ? 4 : 0; i3 >= 0; --i3){
				int v = u + dif[i1] + (dif[i2] << 8) + (dif[i3] << 16);
				if(vis[v] > tm0){ continue; }
				if(check(u, v)){
					if(v == goal){ return tm; }
					vis[v] = tm;
					q[1].push_back(v);
				}
			}
		}
	}
}

int main(){
	int w, h;
	while(scanf("%d%d%*d ", &w, &h), w){
		for(int i = 0; i < h; ++i){
			fgets(c[i], 20, stdin);
		}

		int goal = 0;
		int start = 0;
		for(int i = 0; i < h; ++i){
			for(int j = 0; j < w; ++j){
				if(c[i][j] == '#'){
					wall[i << 4 | j] = true;
				}
				else{
					wall[i << 4 | j] = false;
					if(isupper(c[i][j])){
						goal |= (i << 4 | j) << (c[i][j] - 'A') * 8;
					}
					else if(islower(c[i][j])){
						start |= (i << 4 | j) << (c[i][j] - 'a') * 8;
					}
				}
			}
		}

		int tm = solve(start, goal);
		printf("%d\n", tm - tm0);

		tm0 = tm + 1;
		if(tm0 > 55000){
			memset(vis, 0, sizeof vis);
			tm0 = 0;
		}
	}
}

Compiler output:
a.cc:10:1: error: 'vector' does not name a type
   10 | vector<int> q[2];
      | ^~~~~~
a.cc: In function 'int solve(int, int)':
a.cc:34:9: error: 'q' was not declared in this scope
   34 |         q[0].clear();
      |         ^
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
ld eps=1e-9;

short memo[16][16][16][16][16][16];
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,1,0,-1 };

int mget(vector<pair<int, int>>&ps) {

	return memo[ps[0].first][ps[0].second][ps[1].first][ps[1].second][ps[2].second][ps[3].second];
}
void mset(vector<pair<int, int>>&ps,const int value) {

	memo[ps[0].first][ps[0].second][ps[1].first][ps[1].second][ps[2].second][ps[3].second]=value;
}
struct aa {
	vector<pair<int, int>>coors;
	int turn;
};
int main() {
	while (1) {
		memset(memo, -1, sizeof(memo));
		int W, H, N; cin >> W >> H >> N;
		vector<vector<int>>field(H, vector<int>(W));
		vector<pair<int, int>>s(3);
		vector<pair<int, int>>f(3);
		for (int i = 0; i < H; ++i) {
			string st;
			getline(cin, st);
			for (size_t j = 0; j < W; j++)
			{
				if (st[j] == '#') {
					field[i][j] = 1;
				}
				else if (st[j] == ' ') {

				}
				else if (st[j] <= 'c' || st[j] >= 'a') {
					f[st[j] - 'a'] = make_pair(j, i);
				}
				else {
					s[st[j] - 'A'] = make_pair(j, i);
				}
			}
		}
		mset(s, 0);
		queue<aa>que;
		que.push(s, 0);
		int ans = 0;
		while (!que.empty()) {
			aa atop(que.front());
			que.pop();
			auto from = atop.coors;
			
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:25: error: no matching function for call to 'std::queue<aa>::push(std::vector<std::pair<int, int> >&, int)'
   55 |                 que.push(s, 0);
      |                 ~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = aa; _Sequence = std::deque<aa, std::allocator<aa> >; value_type = aa]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = aa; _Sequence = std::deque<aa, std::allocator<aa> >; value_type = aa]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note:   candidate expects 1 argument, 2 provided
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

bool wall[16*16];
int mv[] = {0, 1, -1, 16, -16};

int compress(int pa, int pb, int pc){
	return (pa)|(pb<<8)|(pc<<16);
}

int solve(int start, int goal){
	static bool visit[16*16*16*16*16*16];
	memset(visit, false, sizeof(visit));
	visit[start] = true;
	vector<int> state[2]; state[0].push_back(start);
	for(int res=1; ;res++){
		int cur = 1-res%2, next = res%2;
		state[next].clear();
		for(int i=0;i<state[cur].size();i++){
			int pa = state[cur][i]%256, pb = (state[cur][i]>>8)%256, pc = (state[cur][i]>>16);
			for(int a=0;a<5;a++){
				int npa = pa + mv[a];
				if(wall[npa]) continue;
				for(int b=0;b<(pb?5:1);b++){
					int npb = pb + mv[b];
					if(npb!=0){
						if(wall[npb]) continue;
						if(npa==npb) continue;
						if(npb==pa&&npa==pb) continue;
					}
					for(int c=0;c<(pc?5:1);c++){
						int npc = pc + mv[c];
						if(npc!=0){
							if(wall[npc]) continue;
							if(npc==npa||npc==npb) continue;
							if(npc==pa&&npa==pc) continue;
							if(npc==pb&&npb==pc) continue;
						}
						int ns = (npa)|(npb<<8)|(npc<<16);
						if(visit[ns]) continue;
						if(ns==goal) return res;
						visit[ns] = true;
						state[next].push_back(ns);						
					}
				}
			}
		}
	}
	return -1;
}

int main(){
	int w, h, n;
	string mp[16];
	while(cin >> w >> h >> n, w){
		getline(cin, mp[0]);
		for(int i=0;i<h;i++) getline(cin, mp[i]);
		memset(wall, false, sizeof(wall));
		int start = 0, goal = 0;
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				if(mp[i][j]=='#') wall[16*i+j] = true;
				if(islower(mp[i][j])) start |= (16*i+j) << (8*(mp[i][j]-'a'));
				if(isupper(mp[i][j])) goal  |= (16*i+j) << (8*(mp[i][j]-'A'));
			}
		}
		printf("%d\n", solve(start, goal));
	}
}

Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:16:9: error: 'memset' was not declared in this scope
   16 |         memset(visit, false, sizeof(visit));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | #include <string>
a.cc: In function 'int main()':
a.cc:61:17: error: 'memset' was not declared in this scope
   61 |                 memset(wall, false, sizeof(wall));
      |                 ^~~~~~
a.cc:61:17: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <queue>
#include <cstring>
#include <string>
#include <cctype>
#include <iostream>
using namespace std;

char f[16][16];
int fx,fy,N;
int dx[] = {0, 0, -1, 1, 0};
int dy[] = {0, -1, 0, 0, 1};

class Ghost
{
public:
	int x[3],y[3],c;
	bool r;
	
	Ghost(int* i, int* j, int c, bool r)
	:r(r),c(c)
	{
		for(int k=0; k<3; k++)
		{
			x[k]=i[k];
			y[k]=j[k];
			
		}
	}
};

bool move(int x, int y, int p)
{
	if(p>=N) return true;
	if(x<0||y<0||x>=fx||y>=fy) return false;
	if(f[x][y]=='#') return false;
	
	return true;
}

bool crash(int* x, int* y, int* gx, int* gy, int p)
{
	if(p<N) return false;
	for(int i=0; i<p; i++)
	for(int j=i+1; j<p; j++)
	{
		if(x[i]==x[j]&&y[i]==y[j]) return true;
		if(x[i]==gx[j]&&y[i]==gy[j]&&gx[i]==x[j]&&gy[i]==y[j]) return true;
	}
	return false;
}

short h[256][256][256][2];

int main()
{	
	while(scanf("%d%d%d",&fx,&fy,&N), (fx||fy||N))
	{
		int sx[3]={0},sy[3]={0},gx[3]={0},gy[3]={0};
		memset(h,0,sizeof(h));
			
		char s[20];
		
		getchar();
		for(int i=0; i<fy; i++)
		{
			gets(s);
			for(int j=0; j<fx; j++)
			{
				if(islower(s[j]))
				{
					sx[s[j]-'a']=j;
					sy[s[j]-'a']=i;
				}
				if(isupper(s[j]))
				{
					gx[s[j]-'A']=j;
					gy[s[j]-'A']=i;
				}
				
				f[j][i]=s[j];
			}
		}
		
		queue<Ghost> q;
		q.push(Ghost(sx,sy,1,0));
		q.push(Ghost(gx,gy,1,1));
		
		int th[3];
		for(int l=0; l<3; l++)
		{
			th[l]=(sx[l]<<4)+sy[l];
		}
		h[th[0]][th[1]][th[2]][0]=1;
		for(int l=0; l<3; l++)
		{
			th[l]=(gx[l]<<4)+gy[l];
		}
		h[th[0]][th[1]][th[2]][1]=1;
		
		while(!q.empty())
		{
			Ghost g=q.front(); q.pop();
			
			int th[3];

			for(int l=0; l<3; l++)
			{
				th[l]=(g.x[l]<<4)+g.y[l];
			}

			if(h[th[0]][th[1]][th[2]][!g.r])
			{
				printf("%d\n", g.c+h[th[0]][th[1]][th[2]][!g.r]-1);
				break;
			}
			
			
			int tx[3],ty[3];
			for(int i=0; i<3; i++)
			{
				tx[i]=g.x[i];
				ty[i]=g.y[i];
				
			}
			
			for(int i=0; i<5; i++)
			{
				tx[0]=g.x[0]+dx[i], ty[0]=g.y[0]+dy[i];
				if(!move(tx[0],ty[0],0))
				{
					tx[0]=g.x[0];
					ty[0]=g.y[0];
					continue;
				}
				
				for(int j=0; j<(N>1?5:1); j++)
				{
					tx[1]=g.x[1]+dx[j], ty[1]=g.y[1]+dy[j];
					if(N>=2)
					{
						if(!move(tx[1],ty[1], 1) || (crash(tx,ty,g.x,g.y,2)))
						{
							tx[1]=g.x[1];
							ty[1]=g.y[1];
							continue;
						}
					}
					
					for(int k=0; k<(N>2?5:1); k++)
					{
						tx[2]=g.x[2]+dx[k], ty[2]=g.y[2]+dy[k];
						if(N>=3)
						{
							if(!move(tx[2],ty[2], 2) || (crash(tx,ty,g.x,g.y,3)))
							{
								tx[2]=g.x[2];
								ty[2]=g.y[2];
								continue;
							}
						}
						for(int l=0; l<3; l++)
						{
							th[l]=(tx[l]<<4)+ty[l];
						}
	
						if(h[th[0]][th[1]][th[2]][g.r])
						{
							tx[2]=g.x[2];
							ty[2]=g.y[2];
							continue;
						}
						h[th[0]][th[1]][th[2]][g.r]=g.c;
					
						
						q.push(Ghost(tx, ty, g.c+1,g.r));
					}
				}
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:25: error: 'gets' was not declared in this scope; did you mean 'getw'?
   67 |                         gets(s);
      |                         ^~~~
      |                         getw
Language: C++

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

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

map<int, int> values[300];
char str[1000];
int length[300];

int expression(const char *str) {
  if (isdigit(str[0])) { return atoi(str); }
  int name = str[0];
  int index = expression(str + 2);
  if (index > length[name] || !values[name].count(index)) { throw 0; }
  return values[name][index];
}

int main() {
  while (true) {
    REP(i, 300) { values[i].clear(); }
    MEMSET(length, -1);
    int bug = 0;
    int line = 0;
    while (gets(str), str[0] != '.') {
      line++;
      if (bug != 0) { continue; }
      if (strstr(str, "=") == NULL) {
        int name = (int)str[0];
        length[name] = atoi(str + 2);
      } else {
        try {
          int name = (int)str[0];
          int index = expression(str + 2);
          if (index >= length[name]) { throw 0; }
          int right = expression(strstr(str, "=") + 1);
          values[name][index] = right;
        } catch (...) {
          bug = line;
        }
      }
    }
    if (line == 0) { break; }
    printf("%d\n", bug);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:12: error: 'gets' was not declared in this scope; did you mean 'getw'?
   41 |     while (gets(str), str[0] != '.') {
      |            ^~~~
      |            getw
Language: C++

#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
#include <functional>
using namespace std;

vector<int> len;
vector<map<int, int> > value;

int dfs(string& s, int& k)
{
    if(isdigit(s[k])){
        int ret = 0;
        while(k < s.size() && isdigit(s[k])){
            ret *= 10;
            ret += s[k] - '0';
            ++ k;
        }
        return ret;
    }

    char c = s[k];
    k += 2;
    int a = dfs(s, k);
    ++ k;

    if(a == -1 || value[c].find(a) == value[c].end())
        return -1;
    else
        return value[c][a];
}

bool substitute (string& s)
{
    char a=s[0];
    int eq=s.find('='),idx=0;
    int i=dfs(s.substr(2,eq-3),idx);
    if(i==-1 || len[a]<=i) return false;
 
    idx=0;
    int res=dfs(s.substr(eq+1),idx);
    if(res == -1)
        return false;
    value[a][i]=res;
    return true;
}

int solve(vector<string>& s)
{
    len.assign(128, 0);
    value.assign(128, map<int, int>());

    int n = s.size();
    for(int i=0; i<n; ++i){
        if(s[i].find('=') == string::npos){
            int k = 2;
            len[s[i][0]] = dfs(s[i], k);
        }else{
            if(!substitute(s[i]))
                return i + 1;
        }
    }

    return 0;
}

int main()
{
    for(;;){
        vector<string> s;
        for(;;){
            string t;
            cin >> t;
            if(t == ".")
                break;
            s.push_back(t);
        }

        if(s.empty())
            return 0;

        cout << solve(s) << endl;
    }
}

Compiler output:
a.cc: In function 'bool substitute(std::string&)':
a.cc:52:23: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   52 |     int i=dfs(s.substr(2,eq-3),idx);
      |               ~~~~~~~~^~~~~~~~
a.cc:25:17: note:   initializing argument 1 of 'int dfs(std::string&, int&)'
   25 | int dfs(string& s, int& k)
      |         ~~~~~~~~^
a.cc:56:25: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   56 |     int res=dfs(s.substr(eq+1),idx);
      |                 ~~~~~~~~^~~~~~
a.cc:25:17: note:   initializing argument 1 of 'int dfs(std::string&, int&)'
   25 | int dfs(string& s, int& k)
      |         ~~~~~~~~^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef complex<double> P; //Point
typedef pair<P,P> L; //Line, Segment

const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
namespace std {
  bool operator < (const P& a, const P& b){
    return fabs(real(a)-real(b)) < EPS ? imag(a) < imag(b) : real(a) < real(b);
  }
}

double dot(P a, P b){ return real(conj(a)*b); }
double cross(P a, P b){ return imag(conj(a)*b); }
int ccw(P a, P b, P c){
  b -= a;
  c -= a;
  if(cross(b,c) > EPS) return 1;   // ????????????(b-a)????????´???????????????(c-a)????????¨?????????
  if(cross(b,c) < -EPS) return -1; // ????????????(b-a)????????´???????????????(c-a)????????¨?????????
  if(dot(b,c) < -EPS) return 2;
  if(norm(b) < norm(c)) return -2;
  return 0;
}

P crossPoint(L l, L m){
  double A = cross(l.second - l.first, m.second - m.first);
  double B = cross(l.second - l.first, l.second - m.first);
  if(fabs(A) < EPS && fabs(B) < EPS) return m.first;
  else if(fabs(A) >= EPS) return m.first + B / A * (m.second - m.first);
}

vector<P> convex_cut(vector<P> G, L l){
  vector<P> res;
  for(int i=0;i<G.size();i++){
    P A = G[i];
    P B = G[(i+1)%G.size()];
    if(ccw(l.first, l.second, A) != -1) res.push_back(A);
    if(ccw(l.first, l.second, A) * ccw(l.first, l.second, B) < 0)
      res.push_back(crossPoint(L(A,B), l));
  }
  return res;
}
h
bool check(vector<P> G,double d){
  vector<P> pol=G;
  int n=G.size();
  for(int i=0;i<n;i++){
    P a=G[i],b=G[(i+1)%n],c=(b-a);
    b=P(abs(c),d)*(c/abs(c))+a;
    a=b-c;
    pol=convex_cut(pol,L(a,b));
    if(pol.size()<3)return 0;
  }
  return  1;
}


int main(){
  int n;
  while(cin>>n,n){
    vector<P> pol(n);
    for(int i=0,x,y;i<n;i++){
      cin>>x>>y;
      pol[i]=P(x,y);
    }
    double L=0,M,R=1e4;
    while(L<R){
      M=(L+R)/2;
      if(!check(pol,M)) R=M-EPS;
      else L=M+EPS;
    }
    printf("%.10f\n",L);
  }
  return 0;
}

Compiler output:
a.cc:44:1: error: 'h' does not name a type
   44 | h
      | ^
a.cc: In function 'int main()':
a.cc:70:11: error: 'check' was not declared in this scope
   70 |       if(!check(pol,M)) R=M-EPS;
      |           ^~~~~
a.cc: In function 'P crossPoint(L, L)':
a.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
Language: C++

#!/usr/bin/env python

import sys
import math
import itertools as it
from collections import deque

sys.setrecursionlimit(10000000)

while True:
    n, w = map(int, raw_input().split())
    if n == 0:
        break
    lst = []
    for i in range(n):
        num = input()
        num /= w
        lst.append(num)
    max_num = max(lst)

    ans = 0.0
    cnt = [0 for i in range(100)]
    for i in range(n):
        num = max_num - lst[i]
        ans += num
        cnt[num] += 1
    
    max_cnt = max(cnt)
    print ans / max_num / max_cnt + 0.01
    pass


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python
      |  ^
a.cc:3:1: error: 'import' does not name a type
    3 | import sys
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
#include<cmath>
#define eps 1e8
using namespace std;
  int n,w;
double histogram[10];

double calc(double bar){
  double hightest=0;
  for(int i=0;i<bar;i++){
    hightest=max(hightest,histogram[i]);
  }

  double res=0;
  for(int i=0;i<bar;i++){
    res+=(histogram[i]/hightest) * ((bar-1-i)/(bar-1));
  }
  return res;
}

int main(){
  while(cin>>n>>w,n){
    memset(histogram,0,sizeof(histogram));
    int data[n];
    for(int i=0;i<n;i++)cin>>data[i];
    for(int i=0;i<n;i++){
      histogram[data[i]/w]++;
    }
    int bar;
    for(int i=n-1;i>=0;i--)
      if(histogram[i]>0){
	bar=i+1;
	break;
      }
    // for(int i=0;i<bar;i++){
    //   cout << "histgram[" << i << "]:" << histogram[i] << endl;
    // }
    double ans=calc(bar);
    ans+=0.01;
    printf("%f\n",ans);
  }
  return 0;
}

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

#include <iostream>

using namespace std;

int main(){
  int N,W,x;
  while(cin >> N >> W, N){
    int n = 0;
    double p[11] = {0};
    for(int i = 0 ; i < N ; i++){
      cin >> x; p[x/W]++;
      n = max(n,x/W);
    }
    double den = *max_element(p,p+11);
    double ans = 0,t = n;
    for(int i = 0 ; i < n ; i++){
      ans += (p[i]/den)*(t--/n);
    }
    printf("%f\n",ans+0.01);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: 'max_element' was not declared in this scope
   14 |     double den = *max_element(p,p+11);
      |                   ^~~~~~~~~~~