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

#include <iostream>
#include <vector>
#include <functional>

using namespace std;

const int INF = 1<<29;

int main(){
  int n, m;
  while(cin >> n >> m && (n|m)){
    vector<int> C(m);
    for(int i=0; i<m; i++) cin >> C[i];
    
    vector<int> dp(256, INF);
    dp[128] = 0;
    while(n--) {
      vector<int> next(256, INF);
      int in; cin >> in;
      for(int i=0; i<=255; i++){
	if(dp[i] < INF) {
	  for(int j=0; j<m; j++){
	    int now = i + C[j];
	    if(now < 0)   { now = 0;   }
	    if(now > 255) { now = 255; }
	    int diff = (in - now) * (in - now);
	    next[now] = min(next[now], dp[i] + diff );
	  }
	}
      }
      dp = next;
    }
    
    cout << *min_element(dp.begin(), dp.end()) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:14: error: 'min_element' was not declared in this scope
   34 |     cout << *min_element(dp.begin(), dp.end()) << endl;
      |              ^~~~~~~~~~~
Language: C

/*
 * hujx.cpp
 *
 *  Created on: 2015年5月21日
 *      Author: dell
 */
#include<stdio.h>
#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<iomanip>
#include<vector>
#include<time.h>
#include<queue>
#include<stack>
#include<iterator>
#include<math.h>
#include<stdlib.h>
#include<limits.h>
#include<map>
#include<set>
#include<bitset>
//#define ONLINE_JUDGE
#define eps 1e-5
#define INF 0x7fffffff
#define FOR(i,a) for((i)=0;i<(a);(i)++)
#define MEM(a) (memset((a),0,sizeof(a)))
#define sfs(a) scanf("%s",a)
#define sf(a) scanf("%d",&a)
#define sfI(a) scanf("%I64d",&a)
#define pf(a) printf("%d\n",a)
#define pfI(a) printf("%I64d\n",a)
#define pfs(a) printf("%s\n",a)
#define sfd(a,b) scanf("%d%d",&a,&b)
#define sft(a,b,num) scanf("%d%d%d",&a,&b,&num)
#define for1(i,a,b) for(int i=(a);i<b;i++)
#define for2(i,a,b) for(int i=(a);i<=b;i++)
#define for3(i,a,b)for(int i=(b);i>=a;i--)
#define MEM1(a) memset(a,0,sizeof(a))
#define MEM2(a) memset(a,-1,sizeof(a))
#define ll long long
const double PI=acos(-1.0);
template<class T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<class T> T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T> inline T Min(T a,T b){return a<b?a:b;}
template<class T> inline T Max(T a,T b){return a>b?a:b;}
using namespace std;
//#pragma comment(linker,"/STACK:1024000000,1024000000")
int n,m,x;
#define N 210
#define M 100010
#define Mod 1000000000
#define p(x,y) make_pair(x,y)
const int MAX_len=550;
int dpl[N][N];
int dps[N][N];
int des[1010];
int dp[N][N];
void Init(){
	for(int i=0;i<=n;i++){
		for(int j=0;j<=m;j++){
			if(i == j) dpl[i][j] = dps[i][j] = 0;
			else
				dpl[i][j] = dps[i][j] = 100000000;
		}
	}
}
void Floyd(){
	for(int k=0;k<n;k++){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				dpl[i][j] = Min(dpl[i][j],dpl[i][k]+dpl[k][j]);
				dps[i][j] = Min(dps[i][j],dps[i][k]+dps[k][j]);
			}
		}
	}
}
int main(){
    while(scanf("%d%d",&n,&m)!=EOF && n+m){
    	int u,v,c;
    	char ch[5];
    	Init();
    	for(int i=0;i<m;i++){
    		scanf("%d%d%d%s",&u,&v,&c,ch);
    		u--,v--;
    		if(ch[0] == 'L'){
    			dpl[u][v] = dpl[v][u] = Min(dpl[u][v],c);
    		}else{
    			dps[u][v] = dps[v][u] = Min(dps[u][v],c);
    		}
    	}
    	int d;
    	sf(d);
    	for(int i=0;i<d;i++){
    		sf(u);
    		u--;
    		des[i] = u;
    	}
    	Floyd();
    	for(int i=0;i<n;i++)
    		for(int j=0;j<n;j++)
    			dp[i][j] = 100000000;

    	for(int i=0;i<n;i++)
    		dp[0][i] = dps[des[0]][i]+dpl[i][des[0]];
    	for(int i=1;i<d;i++){
    		for(int j=0;j<n;j++){
    			for(int k=0;k<n;k++){
    				if(j != k)
    				dp[i][k] = Min(dp[i][k],dp[i-1][j]+dpl[des[i-1]][j]+dps[j][k]+dpl[k][des[i]]);
    				else
    					dp[i][j] = Min(dp[i][j],dp[i-1][j]+dpl[des[i-1]][des[i]]);
    			}
    		}
    	}
    	int ans = INF;
    	for(int i=0;i<n;i++)
    		ans = Min(ans,dp[d-1][i]);
    	printf("%d\n",ans);
    }
    return 0;
}

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

#include<cstdio>
#include<utility>
#include<vector>
#include<queue>
#define MAX_N 200
using namespace std;
typedef pair<int,int>p;
typedef struct node
{
	int p,n,b,c;
	bool operator <(const node &a)const{ return c>a.c;};
}node;
vector<p> Sea[MAX_N],Land[MAX_N];
int N,M,R,des[1000];
int d[1005][205][205];
priority_queue<node>Q;

void f(node tmp,vector<p> edge,bool Boat)
{
	node ins;
	ins.n=tmp.p==des[tmp.n]?tmp.n+1:tmp.n;
	for(int i=0;i<edge.size();i++)
	{
		ins.p=edge[i].first;
		ins.b=Boat?edge[i].first:tmp.b;
		if(d[ins.n][ins.p][ins.b]>tmp.c+edge[i].second)
		{
			ins.c=d[ins.n][ins.p][ins.b]=tmp.c+edge[i].second;
			Q.push(ins);
		}
	}
}

int dij()
{
	for(;!Q.empty();Q.pop());
	memset(d,0x77,sizeof(d));
	d[0][des[0]][des[0]]=0;
	node tmp={des[0],1,des[0],0};
	Q.push(tmp);
	for(;!Q.empty();)
	{
		tmp=Q.top();Q.pop();
		if(d[tmp.n][tmp.p][tmp.b]<tmp.c)continue;
		if(tmp.n==R-1&&tmp.p==des[tmp.n])return tmp.c;
		f(tmp,Land[tmp.p],0);
		if(tmp.b==tmp.p)f(tmp,Sea[tmp.p],1);
	}
	return 0;
}

int main()
{
	for(;scanf("%d%d",&N,&M),N;)
	{
		for(int i=0;i<M;i++)
		{
			int x,y,s;
			char t;
			scanf("%d%d%d %c",&x,&y,&s,&t);
			if(t=='L')
			{
				Land[x].push_back(make_pair(y,s));
				Land[y].push_back(make_pair(x,s));
			}
			else
			{
				Sea[x].push_back(make_pair(y,s));
				Sea[y].push_back(make_pair(x,s));
			}
		}
		scanf("%d",&R);
		for(int i=0;i<R;i++)scanf("%d",&des[i]);
		printf("%d\n",dij());
		for(int i=0;i<200;i++){Land[i].clear();Sea[i].clear();}
	}
}

Compiler output:
a.cc: In function 'int dij()':
a.cc:37:9: error: 'memset' was not declared in this scope
   37 |         memset(d,0x77,sizeof(d));
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<queue>
  +++ |+#include <cstring>
    5 | #define MAX_N 200
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int const MAX_N = 210;
int const MAX_R = 1010;
int const INF = 1<<29;
ll dpl[MAX_N][MAX_N];
ll dps[MAX_N][MAX_N];
ll dpall[MAX_R][MAX_N];
ll N, M;
int z[MAX_R];

int main() {
  
  while(cin >> N >> M && (N|M)) {
    for(int i=0; i<N; i++) {
      dpl[i][i] = dps[i][i] = 0;
      for(int j=i+1; j<N; j++) {
        dpl[i][j] = dpl[j][i] = INF;
        dps[i][j] = dps[j][i] = INF;
      }
    }
    
    for(int i=0; i<M; i++) {
      int x, y, c; char ls;
      cin >> x >> y >> c >> ls; x--, y--;
      if(ls == 'L') {
        dpl[x][y] = dpl[y][x] = c;
      }
      else {
        dps[x][y] = dps[y][x] = c;
      }
    }
    
    int r; cin >> r;
    for(int i=0; i<r; i++) {
      cin >> z[i]; z[i] --;
    }
    
    for(int k=0; k<N; k++) {
      for(int i=0; i<N; i++) {
        for(int j=0; j<N; j++) {
          dpl[i][j] = min(dpl[i][j], dpl[i][k]+dpl[k][j]);
          dps[i][j] = min(dps[i][j], dps[i][k]+dps[k][j]);
        }
      }
    }

    fill(dp[0], dp[0]+MAX_R*MAX_N, 0);
    for(int i=1; i<R; i++) {
      for(int s=0; s<N; s++)
        for(int t=0; t<N; t++) {
          dpall[i][t] = min(dpall[i][t], dpall[i-1][s] + dpl[z[i-1]][s] + dps[s][t] + dpl[t][z[i]]);
          dpall[i][t] = min(dpall[i][t], dp[i-1][t] + dpl[z[i-1]][z[i]]);
        }
    }
    
    cout << *min_element(dp[R-1], dp[R]) << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:10: error: 'dp' was not declared in this scope; did you mean 'dup'?
   52 |     fill(dp[0], dp[0]+MAX_R*MAX_N, 0);
      |          ^~
      |          dup
a.cc:53:20: error: 'R' was not declared in this scope
   53 |     for(int i=1; i<R; i++) {
      |                    ^
a.cc:61:29: error: 'R' was not declared in this scope
   61 |     cout << *min_element(dp[R-1], dp[R]) << endl;
      |                             ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int const MAX_N = 210;
int const INF = 1<<29;

int dl[MAX_N][MAX_N];
int ds[MAX_N][MAX_N];
int dp[MAX_R][MAX_N];
int z[MAX_R];
int N, M, R;

int main() {
  
  while(cin >> N >> M && (N|M)) {
    for(int i=0; i<N; i++) {
      for(int j=i+1; j<N; j++) {
        dl[x][y] = dl[y][x] = INF;
        ds[x][y] = ds[y][x] = INF;
      }
      dl[x][y] = dl[y][x] = ds[x][y] = ds[y][x] = 0;
    }
    for(int i=0; i<M; i++) {
      int x, y, t; char sl;
      cin >> x >> y >> t >> sl; x--, y--;
      if(sl == 'L') {
        dl[x][y] = dl[y][x] = t;
      }
      else {
        ds[x][y] = ds[y][x] = t;
      }
    }
    
    for(int k=0; k<N; k++)
      for(int i=0; i<N; i++)
        for(int j=0; j<N; j++) {
          dl[i][j] = min(dl[i][j], dl[i][k]+dl[k][j]);
          ds[i][j] = min(ds[i][j], ds[i][k]+ds[k][j]);
        }
    
    cin >> R;
    for(int i=0; i<R; i++) { cin >> z[i]; z[i]--; }
    
    fill(dp[0], dp[0]+MAX_R*MAX_N, INF);
    dp[0][z[0]] = 0;
    
    for(int i=1; i<R; i++) {
      for(int s=0; s<N; s++) {
        for(int t=0; t<N; t++) {
          dp[i][t] = min(dp[i][t], dp[i-1][s]+dl[z[i-1]][s]+ds[s][t]+dl[t][z[i]]);
        }
      }
    }
    
    cout << *min_element(dp[R-1], dp[R]) << endl;
    
  }
  
  return 0;
}

Compiler output:
a.cc:10:8: error: 'MAX_R' was not declared in this scope; did you mean 'MAX_N'?
   10 | int dp[MAX_R][MAX_N];
      |        ^~~~~
      |        MAX_N
a.cc:11:7: error: 'MAX_R' was not declared in this scope; did you mean 'MAX_N'?
   11 | int z[MAX_R];
      |       ^~~~~
      |       MAX_N
a.cc: In function 'int main()':
a.cc:19:12: error: 'x' was not declared in this scope
   19 |         dl[x][y] = dl[y][x] = INF;
      |            ^
a.cc:19:15: error: 'y' was not declared in this scope
   19 |         dl[x][y] = dl[y][x] = INF;
      |               ^
a.cc:22:10: error: 'x' was not declared in this scope
   22 |       dl[x][y] = dl[y][x] = ds[x][y] = ds[y][x] = 0;
      |          ^
a.cc:22:13: error: 'y' was not declared in this scope
   22 |       dl[x][y] = dl[y][x] = ds[x][y] = ds[y][x] = 0;
      |             ^
a.cc:43:37: error: 'z' was not declared in this scope
   43 |     for(int i=0; i<R; i++) { cin >> z[i]; z[i]--; }
      |                                     ^
a.cc:45:10: error: 'dp' was not declared in this scope; did you mean 'dup'?
   45 |     fill(dp[0], dp[0]+MAX_R*MAX_N, INF);
      |          ^~
      |          dup
a.cc:45:23: error: 'MAX_R' was not declared in this scope; did you mean 'MAX_N'?
   45 |     fill(dp[0], dp[0]+MAX_R*MAX_N, INF);
      |                       ^~~~~
      |                       MAX_N
a.cc:46:11: error: 'z' was not declared in this scope
   46 |     dp[0][z[0]] = 0;
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int const MAX_R = 1010;
int const MAX_N = 210;
int const INF = 1<<29;

int dl[MAX_N][MAX_N];
int ds[MAX_N][MAX_N];
int dp[MAX_R][MAX_N];
int z[MAX_R];
int N, M, R;

int main() {
  
  while(cin >> N >> M && (N|M)) {
    for(int i=0; i<N; i++) {
      for(int j=i+1; j<N; j++) {
        dl[x][y] = dl[y][x] = INF;
        ds[x][y] = ds[y][x] = INF;
      }
      dl[x][y] = dl[y][x] = ds[x][y] = ds[y][x] = 0;
    }
    for(int i=0; i<M; i++) {
      int x, y, t; char sl;
      cin >> x >> y >> t >> sl; x--, y--;
      if(sl == 'L') {
        dl[x][y] = dl[y][x] = t;
      }
      else {
        ds[x][y] = ds[y][x] = t;
      }
    }
    
    for(int k=0; k<N; k++)
      for(int i=0; i<N; i++)
        for(int j=0; j<N; j++) {
          dl[i][j] = min(dl[i][j], dl[i][k]+dl[k][j]);
          ds[i][j] = min(ds[i][j], ds[i][k]+ds[k][j]);
        }
    
    cin >> R;
    for(int i=0; i<R; i++) { cin >> z[i]; z[i]--; }
    
    fill(dp[0], dp[0]+MAX_R*MAX_N, INF);
    dp[0][z[0]] = 0;
    
    for(int i=1; i<R; i++) {
      for(int s=0; s<N; s++) {
        for(int t=0; t<N; t++) {
          dp[i][t] = min(dp[i][t], dp[i-1][s]+dl[z[i-1]][s]+ds[s][t]+dl[t][z[i]]);
        }
      }
    }
    
    cout << *min_element(dp[R-1], dp[R]) << endl;
    
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'x' was not declared in this scope
   20 |         dl[x][y] = dl[y][x] = INF;
      |            ^
a.cc:20:15: error: 'y' was not declared in this scope
   20 |         dl[x][y] = dl[y][x] = INF;
      |               ^
a.cc:23:10: error: 'x' was not declared in this scope
   23 |       dl[x][y] = dl[y][x] = ds[x][y] = ds[y][x] = 0;
      |          ^
a.cc:23:13: error: 'y' was not declared in this scope
   23 |       dl[x][y] = dl[y][x] = ds[x][y] = ds[y][x] = 0;
      |             ^
Language: C++

// AOJ 2200 (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2200)
#include<cstdio>
#include<queue>
#include<vector>
#include<limits>
#define rep(i,a) for(int i=0;i<(a);++i)

const int MAX_N = 200, MAX_R = 1000, INF = std::numeric_limits<int>::max()>>4;

int N, M, R;
int land[MAX_N][MAX_N], sea[MAX_N][MAX_N];
int dp[MAX_R+1][MAX_N];
int z[MAX_N];

int main()
{
	while( scanf( "%d%d", &N, &M ), N|M )
	{
		rep( i, N ) rep( j, N )
			land[i][j] = sea[i][j] = i==j?0:INF;

		rep( i, M )
		{
			int x, y, t;
			char sl[2];

			scanf( "%d%d%d%s", &x, &y, &t, sl );
			--x; --y;

			auto mat = *sl=='L'?land:sea;
			mat[x][y] = mat[y][x] = std::min( mat[x][y], t );
		}

		scanf( "%d", &R );
		rep( i, R )
			scanf( "%d", z+i ), --z[i];

		rep( k, N ) rep( i, N ) rep( j, N )
		{
			land[i][j] = std::min( land[i][j], land[i][k]+land[k][j] );
			sea[i][j] = std::min( sea[i][j], sea[i][k]+sea[k][j] );
		}

		rep( i, R+1 ) rep( j, N+1 )
			dp[i][j] = INF;
		
		dp[0][z[0]] = 0;
		rep( i, R-1 ) rep( j, N ) rep( k, N )
		{
			if( j != k )
				dp[i+1][j] = std::min( dp[i+1][j], dp[i][k]+land[z[i]][k]+sea[k][j]+land[j][z[i+1]] );
			else
				dp[i+1][j] = std::min( dp[i+1][j], dp[i][j]+land[z[i]][z[i+1]] );
		}

		printf( "%d\n", *std::min_element( dp[R-1], dp[R-1]+N ) );
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:39: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   56 |                 printf( "%d\n", *std::min_element( dp[R-1], dp[R-1]+N ) );
      |                                       ^~~~~~~~~~~
      |                                       tuple_element
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#define min(a, b) ((a) < (b) ? (a) : (b))
#define inf 1e8

using namespace std;

int n, m, s[202][202], h[202][202], dp[202][202], l[202];

int main()
{
	int i, j, k, x, y, z;
	char c[2];
	while (scanf("%d%d", &n, &m) && (n || m))
	{
		for (i = 1; i <= n; i++)
		{
			fill(h[i], h[i] + n + 1, inf);
			fill(s[i], s[i] + n + 1, inf);
			fill(dp[i], dp[i] + n + 1, inf);
			h[i][i] = s[i][i] = 0;
		}
		for (i = 0; i < m; i++)
		{
			scanf("%d%d%d%s", &x, &y, &z, c);
			if (c[0] == 'L')
			{
				h[y][x] = min(h[y][x], z);
				h[x][y] = h[y][x];
			}
			else
			{
				s[y][x] = min(s[y][x], z);
				s[x][y] = s[y][x];
			}
		}
		for (k = 1; k <= n; k++)
			for (i = 1; i <= n; i++)
				for (j = 1; j <= n; j++)
				{
					h[i][j] = min(h[i][j], h[i][k] + h[k][j]);
					s[i][j] = min(s[i][j], s[i][k] + s[k][j]);
				}
		scanf("%d", &m);
		for (i = 0; i < m; i++)
			scanf("%d", &l[i]);
		for (j = 1; j <= n; j++)
			dp[0][j] = s[l[0]][j] + h[j][l[0]];
		for (i = 1; i < m; i++)
		{
			for (j = 1; j <= n; j++)
			{
				for (k = 1; k <= n; k++)
				{
					if (j != k)
						dp[i][k] = min(dp[i][k], dp[i-1][j] + h[l[i-1]][j] + s[j][k] + h[k][l[i]]);
					else
						dp[i][k] = min(dp[i][k], dp[i-1][k] + h[l[i-1]][l[i]]);
				}
			}
		}
		printf("%d\n", *min_element(dp[m-1] + 1, dp[m-1] + n + 1));
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:33: error: 'min_element' was not declared in this scope
   64 |                 printf("%d\n", *min_element(dp[m-1] + 1, dp[m-1] + n + 1));
      |                                 ^~~~~~~~~~~
Language: C++

import java.util.Arrays;
import java.util.Scanner;
public class Main{
	public static void main(String[] args)throws Exception{
		new Main().solve();
	}
	void solve(){
		Scanner sc=new Scanner(System.in);
		while(true){
			int n=sc.nextInt();//the number of cities
			int m=sc.nextInt();//the number of paths
			if(n==0&&m==0)break;
			int INF=Integer.MAX_VALUE/4;
			int[][] ldis=new int[n][n];
			int[][] sdis=new int[n][n];
			for(int i=0;i<n;i++){
				for(int j=0;j<n;j++){
					if(i==j)continue;
					ldis[i][j]=INF;
					sdis[i][j]=INF;
				}
			}
			for(int i=0;i<m;i++){
				int x=sc.nextInt()-1;
				int y=sc.nextInt()-1;
				int t=sc.nextInt();
				String str=sc.next();
				if(str.equals("L")){
					ldis[x][y]=t;
					ldis[y][x]=t;
				}else if(str.equals("S")){
					sdis[x][y]=t;
					sdis[y][x]=t;
				}
			}
			for(int i=0;i<n;i++){
				for(int j=0;j<n;j++){
					if(i==j)continue;
					for(int k=0;k<n;k++){
						ldis[i][j]=Math.min(ldis[i][j],ldis[i][k]+ldis[k][j]);
						sdis[i][j]=Math.min(sdis[i][j],sdis[i][k]+sdis[k][j]);
					}
				}
			}
			int r=sc.nextInt();
			int[] destination=new int[r];
			for(int i=0;i<r;i++){
				destination[i]=sc.nextInt()-1;
			}
			int[][] dp=new int[r][n];
			for(int i=0;i<r;i++){
				for(int j=0;j<n;j++){
					dp[i][j]=INF;
				}
			}
			dp[0][destination[0]]=0;//dp[i][j]???i???????????§?¨?????????????j????????????????????´???????????????
			for(int i=1;i<r;i++){
				for(int j=0;j<n;j++){
					for(int k=0;k<n;k++){
						if(k==j){
							dp[i][j]=
									Math.min(dp[i][j],
											ldis[destination[i]][destination[i-1]]
													+dp[i-1][j]);
							continue;
						}
						dp[i][j]=Math.min(dp[i][j],ldis[destination[i]][j]+sdis[j][k]+ldis[k][destination[i-1]]+dp[i-1][k]);
					}
				}
			}
			int min=9999999;
			for(int i=0;i<n;i++){
				min=Math.min(dp[r-1][i],min);
			}
			System.out.println(min);
		}
	}
	void tr(Object...o){System.out.println(Arrays.deepToString(o));}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Arrays;
      | ^~~~~~
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 java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main{
      | ^~~~~~
Language: C++

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

int n,m,r;
int dl[222][222];
int ds[222][222];
int dp[1111][222];
int rs[1111];

int main(){
	cin.sync_with_stdio(false);
  while(1){
    cin>>n>>m;
    if(n==0)break;
    rep(i,222)rep(j,222){
      dl[i][j]=i==j?0:INF;
      ds[i][j]=i==j?0:INF;
      dist[i][j]=INF;
    }
    rep(i,m){
      int x,y,t; string sl;
      cin>>x>>y>>t>>sl; x--; y--;
      if(sl=="L"){
        dl[x][y]=dl[y][x]=t;
      }else{
        ds[x][y]=ds[y][x]=t;
      }
    }
    rep(k,n)rep(i,n)rep(j,n){
      minch(dl[i][j],dl[i][k]+dl[k][j]);
      minch(ds[i][j],ds[i][k]+ds[k][j]);
    }
    cin>>r;
    rep(i,r){
      cin>>rs[i];
      rs[i]--;
    }
    dp[0][rs[0]]=0;
    rep(i,r-1){
      int crt=rs[i],nxt=rs[i+1];
      rep(j,n){
        minch(dp[i+1][j],dp[i][j]+dl[crt][nxt]);
        if(crt==j){
          rep(k,n)minch(dp[i+1][k],dp[i][j]+dl[crt][j]+ds[j][k]+dl[k][nxt]);
        }
        rep(k,n)minch(dp[i+1][k],dp[i][j]+ds[crt][k]+dl[k][nxt]);
      }
    }
    int res=INF;
    rep(j,222)minch(res,dp[r][j]);
    cout<<res<<endl;
  }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:7: error: 'dist' was not declared in this scope
   40 |       dist[i][j]=INF;
      |       ^~~~
Language: C++

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

int n,m,r;
int dl[222][222];
int ds[222][222];
int dp[1111][222];
int rs[1111];

int main(){
	cin.sync_with_stdio(false);
  while(1){
    cin>>n>>m;
    if(n==0)break;
    rep(i,222)rep(j,222){
      dl[i][j]=i==j?0:INF;
      ds[i][j]=i==j?0:INF;
      dist[i][j]=INF;
    }
    rep(i,m){
      int x,y,t; string sl;
      cin>>x>>y>>t>>sl; x--; y--;
      if(sl=="L"){
        dl[x][y]=dl[y][x]=t;
      }else{
        ds[x][y]=ds[y][x]=t;
      }
    }
    rep(k,n)rep(i,n)rep(j,n){
      minch(dl[i][j],dl[i][k]+dl[k][j]);
      minch(ds[i][j],ds[i][k]+ds[k][j]);
    }
    cin>>r;
    rep(i,r){
      cin>>rs[i];
      rs[i]--;
    }
    dp[0][rs[0]]=0;
    rep(i,r-1){
      int crt=rs[i],nxt=rs[i+1];
      rep(j,n){
        minch(dp[i+1][j],dp[i][j]+dl[crt][nxt]);
        if(crt==j){
          rep(k,n)minch(dp[i+1][k],dp[i][j]+dl[crt][j]+ds[j][k]+dl[k][nxt]);
        }
        rep(k,n)minch(dp[i+1][k],dp[i][j]+ds[crt][k]+dl[k][nxt]);
      }
    }
    int res=INF;
    rep(j,n)minch(res,dp[r-1][j]);
    cout<<res<<endl;
  }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:7: error: 'dist' was not declared in this scope
   40 |       dist[i][j]=INF;
      |       ^~~~
Language: C++

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

const int MAX_N=205;
const int MAX_M=10000;
const int MAX_R=1005;
const int INF=0x3f3f3f3f;

int land[MAX_N][MAX_N];
int water[MAX_N][MAX_N];
int N, M, R;
int dp[MAX_R][MAX_N];
int dest[MAX_R];

int main(){
    #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    #endif
    while((cin>>N>>M) && N>0){
        memset(land, 0x3f, sizeof(land));
        memset(water, 0x3f, sizeof(water));
        memset(dp, 0x3f, sizeof(dp));
        int x, y, t; char sl;
        for(int i=0; i<M; i++){
            scanf("%d %d %d %c ", &x, &y, &t, &sl);
            --x; --y;
            if(sl=='L'){
				land[x][y]=min(land[x][y],t);
				land[y][x]=land[x][y];
			}
            else {
				water[x][y]=min(water[x][y], t);
				water[y][x]=water[x][y];
			}
        }
        for(int i=0; i<N; i++) water[i][i]=land[i][i]=0;
        for(int i=0; i<N; i++){
        	for(int j=0; j<N; j++){
            	for(int k=0; k<N; k++){
                	land[j][k]=min(land[j][k], land[j][i]+land[i][k]);
                	water[j][k]=min(water[j][k], water[j][i]+water[i][k]);
            	}
        	}
   	    }
        cin>>R;
        for(int i=0; i<R; i++) {
			cin>>dest[i]; --dest[i];
		}
        for(int i=0; i<N; i++) dp[0][i]=water[dest[0]][i]+land[dest[0]][i];
        int pre=dest[0], z, t;
        for(int i=1; i<R; i++){
            z=dest[i]; 
            for(int j=0; j<N; j++){
                int mincost=INF;
                for(int k=0; k<N; k++){
                    if(dp[i-1][k]!=INF && water[j][k]!=INF 
                    && land[pre][k]!=INF && land[z][j]!=INF){
                        if(j==k) t=dp[i-1][k]+land[pre][z];
                        else t=dp[i-1][k]+water[k][j]+land[pre][k]+land[j][z];
                        mincost=min(mincost, t);
                    }
                }
                dp[i][j]=mincost;
            }
            pre=z;
        }
        int mincost=INF;
        for(int i=0; i<N; i++) mincost=min(mincost, dp[R-1][i]);
        cout<<mincost<<endl;
    }
    #ifndef ONLINE_JUDGE
    fclose(stdin);
    #endif
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:29: error: redeclaration of 'int t'
   53 |         int pre=dest[0], z, t;
      |                             ^
a.cc:26:19: note: 'int t' previously declared here
   26 |         int x, y, t; char sl;
      |                   ^
Language: C++


#include <iostream>
#include <algorithm>
#include <string.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned ll
#define db double
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PII pair<int, int>

const int N=205;
int n,m,x,y,t,r,z[N],W[N][N],L[N][N],dp[1010][N];
char op[4];

void floyd(int (*dp)[N]) {
    for (int k=1;k<=n;k++) {
        dp[k][k]=0;
        for (int i=1;i<=n;i++) {
            for (int j=1;j<=n;j++) {
                if (k!=i&&k!=j&&i!=j) {
                    if (dp[i][k]!=INF&&dp[k][j]!=INF) {
                        dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j]);
                    }
                }
            }
        }
    }
}

int main()
{
    while (true) {
        scanf("%d%d",&n,&m);
        if (n==0&&m==0) break;
        memset(W,INF,sizeof(W));
        memset(L,INF,sizeof(L));
        memset(dp,INF,sizeof(dp));
        for (int i=1;i<=m;i++) {
            scanf("%d%d%d%s",&x,&y,&t,op);
            if (op[0]=='L') {
                L[x][y]=min(L[x][y],t);
                L[y][x]=L[x][y];
            } else {
                W[x][y]=min(W[x][y],t);
                W[y][x]=W[x][y];
            }
        }
        scanf("%d",&r);
        for (int i=1;i<=r;i++) scanf("%d",z+i);
        floyd(L);
        floyd(W);
        dp[1][1]=0;
        for (int i=2;i<=n;i++) dp[1][i]=W[1][i];
        for (int i=2;i<=r;i++) {
            for (int j=1;j<=n;j++) {
                //if (L[z[i-1]][z[i]]!=INF&&dp[i-1][j]!=INF) {
                //    dp[i][j]=dp[i-1][j]+L[z[i-1]][z[i]];
                //}
                assert(z[i]<N);
                if (dp[i-1][j]!=INF) {
                    dp[i][j]=dp[i-1][j];
                }
            }
        }
        int ans=INF;
        for (int i=1;i<=n;i++) ans=min(ans,dp[r][i]);
        printf("%d\n",ans);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:17: error: 'assert' was not declared in this scope
   65 |                 assert(z[i]<N);
      |                 ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    4 | #include <string.h>
  +++ |+#include <cassert>
    5 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define LL long long 
#define inf 0x3f3f3f3f
int e1[220][220],e2[220][220];
int f[1100][220],a[220];
void init(int N){
	memset(e1,inf,sizeof(e1));
	memset(e2,inf,sizeof(e2));
	memset(f,inf,sizeof(f));
	for(int i=1;i<=N;++i) e1[i][i]=e2[i][i]=0;
}
void floyd(int e[][210],int N){
	int i,j,k;
	for(i=1;i<=N;++i){
		for(j=1;j<=N;++j){
			if(e[i][j]==inf) continue;
			for(k=1;k<=N;++k){
				e[i][k]=min(e[i][k],e[i][j]+e[j][k]);
			}
		}
	}
}
int main(){
	int N,M,i,j,k,u,v,w,R;
	char str[10];
	while(scanf("%d%d",&N,&M)==2){
		if(N==0&&M==0) break;
		init(N);
		while(M--){
			scanf("%d%d%d",&u,&v,&w);
			scanf("%s",str);
			if(!strcmp(str,"L")){
				if(w<e1[u][v]){
					e1[u][v]=e1[v][u]=w;
				}
			}
			else{
				if(w<e2[u][v]){
					e2[u][v]=e2[v][u]=w;
				}
			}
		}
		floyd(e1,N);
		floyd(e2,N);
		scanf("%d",&R);
		for(i=1;i<=R;++i) scanf("%d",a+i);
		f[1][a[1]]=0;
		for(i=1;i<=R;++i){
			for(j=1;j<=N;++j){
				if(f[i][j]!=inf){
					for(k=1;k<=N;++k){
						if(e2[j][k]!=inf&&e1[a[i]][j]!=inf&&e1[a[i+1]][k]!=inf)
						f[i+1][k]=min(
						f[i+1][k],f[i][j]+e1[a[i]][j]+e1[a[i+1]][k]+e2[j][k]);
					}
				}
			}
		}
		int ans=inf;
		for(i=1;i<=N;++i) ans=min(ans,f[R][i]);
		cout<<ans<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:23: error: cannot convert 'int (*)[220]' to 'int (*)[210]'
   44 |                 floyd(e1,N);
      |                       ^~
      |                       |
      |                       int (*)[220]
a.cc:13:16: note:   initializing argument 1 of 'void floyd(int (*)[210], int)'
   13 | void floyd(int e[][210],int N){
      |            ~~~~^~~~~~~~
a.cc:45:23: error: cannot convert 'int (*)[220]' to 'int (*)[210]'
   45 |                 floyd(e2,N);
      |                       ^~
      |                       |
      |                       int (*)[220]
a.cc:13:16: note:   initializing argument 1 of 'void floyd(int (*)[210], int)'
   13 | void floyd(int e[][210],int N){
      |            ~~~~^~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? 1e9:1e18)
#define EPS 0.0000000001
using namespace std;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
template<class T> void join(T a){int b=0;for(auto itr :a){if(b++!=0)cout << " "; cout << itr;} }
using ll  = long long;
using ld  = long double;
using pii = pair<int,int>;
using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
#define int ll
signed main(){
    int n,m;
    while(cin >> n >> m, n+m){
        auto Ld = vectors(301,301,INF);
        auto Sd = vectors(301,301,INF);
        rep(i,n)Ld[i][i] = Sd[i][i] = 0;
        rep(i,m){
            int a,b,c; char s;
            cin >> a >> b >> c >> s;
            --a,--b;
            if(s == 'L'){
                cmin(Ld[a][b],c);
                Ld[b][a] = Ld[a][b];
            }else{
                cmin(Sd[a][b], c);
                Sd[b][a] = Sd[a][b];
            }
        }
        rep(k,n)rep(i,n)rep(j,n){
            cmin(Sd[i][j],Sd[i][k] + Sd[k][j]);
            cmin(Ld[i][j],Ld[i][k] + Ld[k][j] );
        }
        int r; cin >> r;
        vector<int>v;
        rep(i,r){
            int t; cin >> t;
            v.push_back(--t);
        }
        auto dp = vectors(300+1,300+1,(int)INF);
        dp[0][r[0]]=0;
        rep(i,n-1){
            if(i == 0){
                rep(k,n)dp[0][k] = Ld[v[i]][k] + Sd[v[i]][k] + Ld[k][v[i]];
            }
            rep(j,n){
                rep(k,n){
                    cmin(dp[i+1][j],dp[i][k] + Ld[v[i]][k] + Sd[k][j] + Ld[j][v[i+1]]);
                }
            }
        }
        int ans = INF;
        rep(i,n)cmin(ans,dp[n-1][i]);
        cout << ans << endl;
    }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:54:16: error: invalid types 'll {aka long long int}[int]' for array subscript
   54 |         dp[0][r[0]]=0;
      |                ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? 1e9:1e18)
#define EPS 0.0000000001
using namespace std;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
template<class T> void join(T a){int b=0;for(auto itr :a){if(b++!=0)cout << " "; cout << itr;} }
using ll  = long long;
using ld  = long double;
using pii = pair<int,int>;
using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
#define int ll
signed main(){
    int n,m;
    while(cin >> n >> m, n+m){
        auto Ld = vectors(301,301,INF);
        auto Sd = vectors(301,301,INF);
        rep(i,n)Ld[i][i] = Sd[i][i] = 0;
        rep(i,m){
            int a,b,c; char s;
            cin >> a >> b >> c >> s;
            --a,--b;
            if(s == 'L'){
                cmin(Ld[a][b],c);
                Ld[b][a] = Ld[a][b];
            }else{
                cmin(Sd[a][b], c);
                Sd[b][a] = Sd[a][b];
            }
        }
        rep(k,n)rep(i,n)rep(j,n){
            cmin(Sd[i][j],Sd[i][k] + Sd[k][j]);
            cmin(Ld[i][j],Ld[i][k] + Ld[k][j] );
        }
        int r; cin >> r;
        vector<int>v;
        rep(i,r){
            int t; cin >> t;
            v.push_back(--t);
        }
        auto dp = vectors(1000+1,300+1,(int)INF);
        dp[0][v[0]]=0;
        rep(i,r-1){
            /*if(i == 0){
                rep(k,n)dp[0][k] = Ld[v[i]][k] + Sd[v[i]][k] + Ld[k][v[i]];
            }*/
            rep(j,n){
                cmin(dp[i+1][k],dp[i][j]+Ld[v[i]][v[i+1]]);
                rep(k,n){
                    cmin(dp[i+1][j],dp[i][k] + Ld[v[i]][k] + Sd[k][j] + Ld[j][v[i+1]]);
                }
            }
        }
        int ans = INF;
        rep(i,n)cmin(ans,dp[n-1][i]);
        cout << ans << endl;
    }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:60:30: error: 'k' was not declared in this scope
   60 |                 cmin(dp[i+1][k],dp[i][j]+Ld[v[i]][v[i+1]]);
      |                              ^
Language: C++

#include "bits\stdc++.h"
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PI;
int distL[200][200];
int distS[200][200];
int dp[2][200];
int z[1000];
int main() {
	int N, M;
	while (cin >> N >> M, N) {
		fill((int*)distL, (int*)(distL + 200), 1 << 25);
		fill((int*)distS, (int*)(distS + 200), 1 << 25);
		for (int i = 0; i < N; i++) distL[i][i] = distS[i][i] = 0;
		for (int i = 0; i < M; i++) {
			int x, y, t;
			char sl[2];
			cin >> x >> y >> t >> sl;
			x--; y--;
			if (sl[0] == 'L') {
				distL[x][y] = distL[y][x] = min(distL[x][y], t);
			}
			else {
				distS[x][y] = distS[y][x] = min(distS[x][y], t);
			}
		}
		for (int k = 0; k < N; k++) {
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < N; j++) {
					distL[i][j] = min(distL[i][j], distL[i][k] + distL[k][j]);
					distS[i][j] = min(distS[i][j], distS[i][k] + distS[k][j]);
				}
			}
		}
		int R;
		cin >> R;
		for (int i = 0; i < R; i++) {
			cin >> z[i];
			z[i]--;
		}
		fill((int*)dp, (int*)(dp + 2), 1 << 25);
		dp[0][z[0]] = 0;
		for (int i = 1; i < R; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if (j == k) dp[i % 2][k] = min(dp[i % 2][k], dp[(i - 1) % 2][j] + distL[z[i - 1]][z[i]]);
					else dp[i % 2][k] = min(dp[i % 2][k], dp[(i - 1) % 2][j] + distL[z[i - 1]][j] + distS[j][k] + distL[k][z[i]]);
				}
			}
			for (int j = 0; j < N; j++) dp[(i - 1) % 2][j] = 1 << 25;
		}
		int ans = 1 << 25;
		for (int i = 0; i < N; i++) ans = min(ans, dp[(R - 1) % 2][i]);
		cout << ans << endl;
	}
}


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

#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;

int land[200][200];
typedef pair<int,int>P;
vector<P>sea[200];

int R,z[1000];

const int INF = 0x0f0f0f0f;

int memo[200][1000];
int Solve(int boat, int index)
{
	if(index >= R)
		return 0;
	int &ref = memo[boat][index];
	if(ref >= 0)
		return ref;
	int from = z[index-1];
	int to = z[index];

	ref = land[from][to] + Solve(boat,index+1);

	for(int i=0;i<sea[boat].size();++i)
	{
		P p=sea[boat][i];
		ref = min(ref, land[from][boat]+p.second+land[p.first][to] + Solve(p.first,index+1));
	}
	return ref;
}

int main()
{
	int n,m,i,j,k;
	int x,y,t;
	char c;
	int seaTemp[200][200];
	while(scanf("%d%d",&n,&m),n)
	{
		for(i=0;i<n;++i)
			sea[i].clear();
		memset(land,INF,sizeof(land));
		memset(seaTemp,INF,sizeof(seaTemp));
		for(i=0;i<n;++i)
			land[i][i]=0;
		while(m--)
		{
			scanf("%d%d%d %c",&x,&y,&t,&c);
			--x,--y;
			if(c=='L')
				land[y][x]=land[x][y] = min(land[y][x],t);
			else
				seaTemp[y][x]=seaTemp[x][y]=min(seaTemp[y][x],t);
		}
		scanf("%d",&R);
		for(i=0; i<R; ++i)
		{
			scanf("%d",z+i);
			--z[i];
		}

		for(k=0;k<n;++k)
			for(i=0;i<n;++i)
				for(j=0;j<n;++j)
					land[i][j]=min(land[i][j],land[i][k]+land[k][j]);

		for(i=0;i<n;++i)
			for(j=i+1;j<n;++j)
			{
				if(seaTemp[i][j]==INF)continue;
				sea[i].push_back(P(j,seaTemp[i][j]));
				sea[j].push_back(P(i,seaTemp[i][j]));
			}
		memset(memo,-1,sizeof(memo));
		printf("%d\n",Solve(z[0],1));
	}
	return 0;
}

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

#define PI 3.141592
#include<stdio.h>
#include<math.h>

int main(){
	int N,i,k;
	scanf("%d",&N);
	while(N != 0){
		int x[N],y[N],r[N],m[N];
		double j;
		for(int i=0;i<N;i++){
			scanf("%d %d %d %d",&x[i],&y[i],&r[i],&m[i]);
		}
		int max = 0;
		for(i=0;i<N;i++){
			for(j=0; j< 2*PI; j=j+0.001){
				double a,b,c,ab;
				if(j == 0 || j == PI){
					a = 1.0;
					b = 0.0;
					c = -x[i]-r[i]*cos(j);
					ab = sqrt(pow(a,2.0)+pow(b,2.0));
				}else{
					a = 1 / tan(j);
					if(a < 0.01 && a > -0.01){
						a = 0.0;
					}
					b = 1.0;
					c = (-x[i]-r[i]*cos(j)) / tan(j) - y[i] - r[i] * sin(j);
					if(a == 0){
						c = (int)(c*1000)/1000;
					}
					ab = sqrt(pow(a,2.0)+pow(b,2.0));
				}
				int tempmax = 0;
				for(k=0;k<N;k++){
					if(i==k){
						tempmax++;
					}else{
						double d = fabs(a*x[k] + b*y[k] + c) / ab;
						if(m[k] == 0){
							if((int)(d+0.5) == r[k]){
								tempmax++;
							}
						}else{
							if(d >= r[k] && d <= r[k] + m[k]){
								tempmax++;
							}
						}
					}
				}
				if(max < tempmax){
					max = tempmax;
				}
			}
		}
		printf("%d\n",max);
		scanf("%d",&N);
	}

}

Compiler output:
/usr/bin/ld: /tmp/cciTIPIs.o: in function `main':
main.c:(.text+0x2b3): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x2ea): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x30c): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x327): undefined reference to `sqrt'
/usr/bin/ld: main.c:(.text+0x343): undefined reference to `tan'
/usr/bin/ld: main.c:(.text+0x3d6): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x400): undefined reference to `tan'
/usr/bin/ld: main.c:(.text+0x45c): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x4e1): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x503): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x51e): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<fstream>
#include"2D.h"
using namespace std;

inline int check(geo::Line l,vector<geo::Circle>& cd, vector<geo::Circle>& cm){
	int res = 0;
	int n = (int)cd.size();
	for (int i = 0; i < n; i++){
		double d = geo::distance( cd[i].first,l);
		//cout << d << " ";
		if (d<cm[i].second +geo::eps&&d>cd[i].second-geo::eps)
			res++;
	}
//	cout << endl;
	return res;


}
int main(){
	//ifstream cin("in.txt");ofstream cout("out.txt");
	while (1){
		int N;
		cin >> N;
		if (N == 0)break;

		vector<geo::Circle> cd(N);
		vector<geo::Circle> cm(N);
		for (int i = 0; i < N; i++){
			double x, y, d, m;
			cin >> x >> y >> d >> m;
			geo::x(cd[i].first, x);
			geo::y(cd[i].first, y);
			geo::x(cm[i].first, x);
			geo::y(cm[i].first, y);
			cd[i].second = d;
			cm[i].second = d+m;
		}
		if (N == 1){
			if (cm[0].second < geo::eps)cout << 0 << endl;
			else cout << 1 << endl;
			continue;
		}
		int res = 0;
		for (int i = 0; i < N; i++){
			for (int j = 0; j < N; j++){
				if (i != j){
					//cout << i << j << endl << endl;
					//cout << "inner1" << endl;
					auto p1 = geo::inner_common_tangent_line(cd[i], cd[j]);
					for (auto& it : p1){
						res=max(check(it, cd, cm),res);
					}
				//	cout << "inner2" << endl;
					auto p2 = geo::inner_common_tangent_line(cd[i], cm[j]);
					for (auto& it : p2){
						res = max(check(it, cd, cm), res);
					}
				//	cout << "inner3" << endl;
					auto p3 = geo::inner_common_tangent_line(cm[i], cm[j]);
					for (auto& it : p3){
						res = max(check(it, cd, cm), res);
					}
				//	cout << "outer1" << endl;
					auto q1 = geo::outer_common_tangent_line(cd[i], cd[j]);
					for (auto& it : q1){
						res = max(check(it, cd, cm), res);
					}
				//	cout << "outer2" << endl;
					auto q2 = geo::outer_common_tangent_line(cd[i], cm[j]);
					for (auto& it : q2){
						res = max(check(it, cd, cm), res);
					}
				//	cout << "outer3" << endl;
					auto q3 = geo::outer_common_tangent_line(cm[i], cm[j]);
					for (auto& it : q3){
						res = max(check(it, cd, cm), res);
					}

				}
			}
		}
		cout << res << endl;
	}
	//cin.close();	cout.close();
	return(0);
}

Compiler output:
a.cc:3:9: fatal error: 2D.h: No such file or directory
    3 | #include"2D.h"
      |         ^~~~~~
compilation terminated.
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] point = new int[100];
		int n;
		while((n = sc.nextInt()) != 0){
			for(int i = 0; i < n; i++){
				for(int j = 0; j < 5; j++){
					point[i] += sc.nextInt();
				}
				System.out.println(point[i]);
			}
			int max = point[0]; int min = point[0];
			for(int i = 0; i < n; i++){
				if(max < point[i]) max = point[i];
				if(min > point[i]) min = point[i];
			}
			System.out.println(max + " " + min);
		}
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

#include <cstdio>
#include <algorithm>

using namespace std;

int main(void)
{
	int i, n, j, s;
	int score[128];
	
	while (scanf("%d", &n), n != 0){
		for (i = 0; i < 128; i++){
			score[i] = 0;
		}
		
		for (i = 0; i < n; i++){
			for (j = 0; j < 5; j++){
				scanf("%d", &s);
				score[i] += s;
			}
		}
		
		sort(score, score + n);
		
		printf("%d %d\n", score[n - 1], score[0]);
	}
	
	return (0);
}

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

#include <stdio.h>

int main(void)
{
	int n,i,max,min;
	int a,j,b;
	
	while(scanf("%d",&n)&&n!=0){
		max=0;
		min=500;
		for(i=0;i<n;i++){
			a=0;
			for(j=0;j<5;j++){
				scanf("%d",&b);
				a+=b;
			}
				a<max?max=max:max=a;
				min<a?min=min:min=a;
		}
		printf("%d %d\n",max,min);
	}
	return 0 ;
}

Compiler output:
main.c: In function 'main':
main.c:17:50: error: lvalue required as left operand of assignment
   17 |                                 a<max?max=max:max=a;
      |                                                  ^
main.c:18:50: error: lvalue required as left operand of assignment
   18 |                                 min<a?min=min:min=a;
      |                                                  ^
Language: C

#include<stdio.h>
int main(void) {
int n,i,test,max=0,min=0;
int t;

scanf("%d",&n);

while(n) {
max=0;min=500;
for(;n>0;n--) {
test = 0;
for(i=0;i<5;i++) {
scanf("%d",&t);
test += t;
}
if(max<test) max=test;
if(min>test) min=test;
}
printf("%d %d",max,min);
scanf("%d",&n)
}
return(0);
}

Compiler output:
main.c: In function 'main':
main.c:20:15: error: expected ';' before '}' token
   20 | scanf("%d",&n)
      |               ^
      |               ;
   21 | }
      | ~
Language: C

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {

		int n;
		List<Integer[]> list = new ArrayList<Integer[]>();


		BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

		while((n = Integer.parseInt(bufferedReader.readLine())) != 0){
			int sum = 0, max = 0, min = 500;
			for(int i = 0; i < n; i++){
				sum = 0;
				String[] valueStrings = bufferedReader.readLine().split(" ");
				for(String s : valueStrings) sum += Integer.parseInt(s);

				max = max < sum ? sum : max;
				min = sum < min ? sum : min;
			}
			list.add(new Integer[]{new Integer(max), new Integer(min)});
		}
		for(Integer[] integer : list) System.out.println(integer[0].intValue()+" "+ integer[1].intValue());

	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.io.BufferedReader;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.io.BufferedReader;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.io.IOException;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.io.IOException;
      |            ^
main.c:3:1: error: unknown type name 'import'
    3 | import java.io.InputStreamReader;
      | ^~~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | import java.io.InputStreamReader;
      |            ^
main.c:4:1: error: unknown type name 'import'
    4 | import java.util.ArrayList;
      | ^~~~~~
main.c:4:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | import java.util.ArrayList;
      |            ^
main.c:5:1: error: unknown type name 'import'
    5 | import java.util.List;
      | ^~~~~~
main.c:5:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 | import java.util.List;
      |            ^
main.c:7:1: error: unknown type name 'public'
    7 | public class Main {
      | ^~~~~~
main.c:7:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    7 | public class Main {
      |              ^~~~
Language: C++

#include<stdio.h>

int main(){
int n;
int a[6];
int ma=0;min=0;
while(1){
scanf("%d",&n);if(n==0)break;
for(int i=0;i<n;i++){
int s=0;
for(int j=0;j<5;j++)
{int x;scanf("%d",&x);s+=x;}
if(i==0)min=s;
if(s>ma)ma=s;
if(s<min)min=s;
}
printf("%d %d\n",ma,min);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'min' was not declared in this scope; did you mean 'main'?
    6 | int ma=0;min=0;
      |          ^~~
      |          main
Language: C++

#include<bits//stdc++.h>
using namespace std;
int main(){
	int n;
	while(cin>>n&&n!=0){
		int a,b;
		int ma=-1111111,mi1000000;
		for(int i=0;i<n;i++){
			b=0;
			for(int j=0;j<5;j++) {
				cin>>a;
				b+=a;
			}
			ma=max(b,ma);
			mi=min(b,mi);
		}
		cout<<ma<<" "<<mi<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: 'mi' was not declared in this scope; did you mean 'i'?
   15 |                         mi=min(b,mi);
      |                         ^~
      |                         i
a.cc:17:32: error: 'mi' was not declared in this scope; did you mean 'ma'?
   17 |                 cout<<ma<<" "<<mi<<endl;
      |                                ^~
      |                                ma
Language: C++

#include <iostream>
using namespace std;

int n;
int r;
int sum[100];

int main(){
	while (cin >> n && n != 0) {
		fill(sum, sum + 99, 0);
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < 5; j++) {
				cin >> r;
				sum[i] += r;
			}
		}
		sort(sum, sum + n - 1);
		cout << sum[0] << " " << sum[n - 1] << endl;
	}

	return 0;
}

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