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

#include<iostream>
using namespace std;

int n;
int m[20][20]={{}};
int inf = 10000000;
int dp[(1<<16)][16];
int k;

int rec(int s,int v){
  if(dp[s][v]>=0) return dp[s][v];

  if(s == (1<<(n+1))-1 && v == 0) return dp[s][v] = 0;

  int res = inf;
  for(int u=0;u<=n;u++){
    if(!(s>>u&1)){
      int cost = m[u][0];
      for(int i=0;i<=n;i++){
	if(s>>i&1)
	  cost= min(cost,m[u][i]);
      }
      res = min(res,rec(s | 1 << u, u)+cost);
    }
  }
  return dp[s][v] = res;
}

int main(){
  int i,j;
  
  
  cin >> n;
  while(n!=0){
    //memset(m,inf,sizeof(m));
    fill(m[0],m[19],inf);
    for(j=0;j<=n;j++) m[0][j]=0;
    for(i=1;i<=n;i++){
      for(j=0;j<=n;j++){
	cin >> m[i][j];
      }
    }
    int s=0;
    memset(dp,-1,sizeof(dp));
    cout << rec(0,0) << endl;
    cin >> n;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:5: error: 'memset' was not declared in this scope
   44 |     memset(dp,-1,sizeof(dp));
      |     ^~~~~~
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++

#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int p[16]={2,3,5,7,11,13,17,23,29,31,37,41,43,47,53,59};
int a[16][17],n;
bool map[16][200000];
long long ans;
void dfs(int depth,int x,int c){
  if(map[depth][x])return;
  map[depth][x]=true;
  if(x>=ans)return;
  if(x>=190000)return;
  if(depth==n-1){ans=x;return;}
  r(i,n)if(c%p[i]!=0)r(j,n+1)if(!j||c%p[j-1]==0)
   dfs(depth+1,x+a[i][j],c*p[i]);
}
int main(){
  while(cin>>n,n){
    r(i,16)r(j,200000)map[i][j]=false;
    ans=1000000;
    r(i,n)r(j,n+1)cin>>a[i][j];
    r(i,n)dfs(0,a[i][0],p[i]);
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:9:6: error: reference to 'map' is ambiguous
    9 |   if(map[depth][x])return;
      |      ^~~
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:6:6: note:                 'bool map [16][200000]'
    6 | bool map[16][200000];
      |      ^~~
a.cc:10:3: error: reference to 'map' is ambiguous
   10 |   map[depth][x]=true;
      |   ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:6:6: note:                 'bool map [16][200000]'
    6 | bool map[16][200000];
      |      ^~~
a.cc: In function 'int main()':
a.cc:19:23: error: reference to 'map' is ambiguous
   19 |     r(i,16)r(j,200000)map[i][j]=false;
      |                       ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:6:6: note:                 'bool map [16][200000]'
    6 | bool map[16][200000];
      |      ^~~
Language: C++

#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[]) {
	while (true) {
		int n;
		cin >> n;
		if (!n) {
			break;
		}
		int z[16];
		int cost[16][16];
		for (int i = 0; i < n; ++i) {
			cin >> z[i];
			for (int j = 0; j < n; ++j) {
				cin >> cost[i][j];
			}
		}
		int dp[1 << 16];
		memset(dp, 0x3f, sizeof(dp));
		dp[0] = 0;
		int m = 1 << n;
		for (int b = 0; b < m; ++b) {
			for (int i = 0; i < n; ++i) {
				if (!(b & (1 << i))) {
					int c = z[i];
					for (int j = 0; j < n; ++j) {
						if (b & (1 << j)) {
							c = min(c, cost[i][j]);
						}
					}
					dp[b | (1 << i)] = min(dp[b | (1 << i)], dp[b] + c);
				}
			}
		}
		cout << dp[m - 1] << endl;
	}
	return 0;
}

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

//8:10
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>

using namespace std;

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define mp make_pair
#define pb push_back

#define MAXt 16*100000

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vp;

typedef long long ll;

int dp[(1<<16)][16];

vvi D;
int N;

int ftime(int c,int d){
    int mi = D[d][0];
    c = c<<1;
    REP(j,1,N+1){
        if(j-1==d) continue;
        if(((1<<j)&c)==1<<j){
            mi = min(mi,D[d][j]);
        }
    }
    return mi;
}

int rec(int c,int d){
    if(dp[c][d]!=0) return dp[c][d];
    c|=(1<<d);//????????????
    // cout<<"@c :"<<c<<endl;
    if(c==(1<<N)-1) return dp[c][d] = ftime(c, d);
    else{
        int mi=MAXt;
        rep(i,N){
            if(i==d)continue;
            if(((1<<i)&c)==1<<i)continue;
            mi = min(mi,ftime(c, d) + rec(c, i));
        }
        return dp[c][d]=mi;
    }
    return MAXt;
}

int main() {
    vvi eD;
    while(1){
        memset(dp,0,sizeof(dp));
        cin>>N;
        if(N==0)break;
        D = eD;
        rep(i,N){
            D.pb(vi());
            rep(j,N+1){
                int t;
                cin>>t;
                D[i].pb(t);
            }
        }
        int mi = MAXt;
        rep(i,N){
            mi = min(mi,rec(0, i));
            // cout<<"@mi: "<<mi<<endl;
        }
        cout<<mi<<endl;
        // rep(i,N){
        //     cout<<"@: ";
        //     rep(j,N+1){
        //         cout<<D[i][j]<<" ";
        //     }
        //     cout<<endl;
        // }
    }


    return 0;
}

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

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
void Bits (int a){
  string s="";
  while(a>0){
    char c='0'+a%2;
    a/=2;
    s+=c;
  }
  reverse(s.begin(),s.end());
  cout<<s<<endl;
}
int memo[70000];
int n;
int ans;
int dist[20][70000];
void dfs(int bits,int sum,int now){
  if(sum>=memo[bits])return;
  //Bits(bits);
  if(((1<<n)-1)==bits){
    ans=min(ans,sum);
    return;
  }
  memo[bits]=sum;
  for(int i=0;i<n;i++){
    if(!(bits&(1<<i))){
      int mimi=dist[i][0];
      for(int j=0;j<n;j++){
	if(bits&(1<<j))
	  mimi=min(dist[i][1<<j],mimi);
      }
      dfs(bits+(1<<i),sum+mimi,i);
    }
  }
  return;
}
int main(){
  while(cin>>n,n){
    ans=INF;
    for(int i=0;i<20;i++)
      for(int j=0;j<70000;j++)
	memo[i][j]=INF;
    for(int i=0;i<n;i++){
      cin>>dist[i][0];
      for(int j=0;j<n;j++)
	cin>>dist[i][(1<<j)];
    }
    for(int i=0;i<n;i++)
      dfs((1<<i),dist[i][0],i);
    cout<<ans<<endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:51:16: error: invalid types 'int[int]' for array subscript
   51 |         memo[i][j]=INF;
      |                ^
Language: C++

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

int n;
long long int dis[20][20];
long long int dp[1 << 16];
long long int inf = 100000 * 16 + 1;

int main() {

    while(true) {

        scanf(" %d",&n);

        if(n == 0){
            break;
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n + 1; j++) {
                scanf(" %lld",&dis[i][j]);
            }
        }

        for (int i = 0; i < (1 << n); i++) {
            dp[i] = inf;
        }

        dp[0] = 0;

        for (int i = 0; i < (1 << n); i++) {
            for (int j = 0; j < n; j++) {
                if (dp[i] == inf) continue;

                //次の状態について探索
                for (int k = 0; k < n; k++) {
                    if ((i >> k) % 2 == 1) {
                        continue;
                    }
                    int next_i = i | (1 << k);
                    long long int min_dis = dis[k][0];

                    for (int r = 0; r < n; r++) {
                        if (i & (1 << r)) {
                            min_dis = min(min_dis, dis[k][r + 1]);
                        }
                    }

                    long long int next_d = dp[i] + min_dis;
                    dp[next_i] = min(dp[next_i], next_d);
                }
            }
        }

        int all = 0;

        for (int i = 0; i < n; i++) {
            int add = 1 << i;
            all += add;
        }

        printf("%lld\n)dp[all]);

    }

    return 0;
}


Compiler output:
a.cc:62:16: warning: missing terminating " character
   62 |         printf("%lld\n)dp[all]);
      |                ^
a.cc:62:16: error: missing terminating " character
   62 |         printf("%lld\n)dp[all]);
      |                ^~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:64:5: error: expected primary-expression before '}' token
   64 |     }
      |     ^
Language: C++

#include <iostream>
using namespace std;

inline int pow2(int x){
	return ( 1 << x );
}

int main(){
	int n;
	int dp[65536];

	while( cin >> n , n ){
		//ツ渉可甘コツ可サ
		int t[20][20] = {0};
		for(int i=0 ; i < pow2(n) ; i++ ){
			dp[i] = INT_MAX;
		}
		
		for(int j=0 ; j < n ; j++ ){
			for(int i=0 ; i < n+1 ; i++ ){
				cin >> t[j][i];
			}
		}
		dp[0] = 0;
		for(int T=0 ; T < pow2(n) ; T++ ){
			for(int j=0 ; j < n ; j++ ){
				for(int i=0 ; i < n ; i++ ){
					//ツスツテツーツジjツづーツクツδ環アツつオツづつ「ツづ按つゥツづつスツづァ
					if( !( T & pow2(j) ) ){
						if( T & pow2(i) ){
							dp[T+pow2(j)] = min( dp[T+pow2(j)] , dp[T]+ t[j][i+1] );
						}else{
							dp[T+pow2(j)] = min( dp[T+pow2(j)] , dp[T]+ t[j][0] );
						}
					}
				}
			}
		}
		cout << dp[ pow2(n)-1 ] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:33: error: 'INT_MAX' was not declared in this scope
   16 |                         dp[i] = INT_MAX;
      |                                 ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

void solve(){

	int n;
	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int score[17][17];
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> score[i][j];
			}
		}

		//  éðóÔÅà¯éÅ¬Ô
		int dp[1 << 16];
		fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = score[i][0];
		}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		for(int s = 3; s < (1 << n); s++){
			// jrbgÚªtrueÈçAvZ
			for(int j = 0; j < n; j++){
				if((s >> j) & 1){
					int sc = INF;
					for(int i = 0; i < n; i++){
						if(((s >> i) & 1) && i != j){
							sc = min(sc,score[j][i+1]);
						}
					}
					// JÚµÄ­é±ÆªÅ«é©Ç¤©
					if(dp[s & ~(1 << j)] != INF){
						dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
					}
				}
			}
		}
		cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:16:40: error: 'score' was not declared in this scope
   16 |                                 cin >> score[i][j];
      |                                        ^~~~~
a.cc:26:38: error: 'score' was not declared in this scope
   26 |                         dp[1 << i] = score[i][0];
      |                                      ^~~~~
a.cc:37:69: error: 'score' was not declared in this scope
   37 |                                                         sc = min(sc,score[j][i+1]);
      |                                                                     ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int score[17][17];
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> score[i][j];
			}
		}

		fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = score[i][0];
		}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		for(int s = 3; s < (1 << n); s++){
			// jrbgÚªtrueÈçAvZ
			for(int j = 0; j < n; j++){
				if((s >> j) & 1){
					int sc = INF;
					for(int i = 0; i < n; i++){
						if(((s >> i) & 1) && i != j){
							sc = min(sc,score[j][i+1]);
						}
					}
					// JÚµÄ­é±ÆªÅ«é©Ç¤©
					if(dp[s & ~(1 << j)] != INF){
						dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
					}
				}
			}
		}
		cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:40: error: 'score' was not declared in this scope
   20 |                                 cin >> score[i][j];
      |                                        ^~~~~
a.cc:28:38: error: 'score' was not declared in this scope
   28 |                         dp[1 << i] = score[i][0];
      |                                      ^~~~~
a.cc:39:69: error: 'score' was not declared in this scope
   39 |                                                         sc = min(sc,score[j][i+1]);
      |                                                                     ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int score[17][17];
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> score[i][j];
			}
		}

		fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = score[i][0];
		}
		
		//// ªóÔ©çSÌóÔðvZiQ»®ðpj
		//for(int s = 3; s < (1 << n); s++){
		//	// jrbgÚªtrueÈçAvZ
		//	for(int j = 0; j < n; j++){
		//		if((s >> j) & 1){
		//			int sc = INF;
		//			for(int i = 0; i < n; i++){
		//				if(((s >> i) & 1) && i != j){
		//					sc = min(sc,score[j][i+1]);
		//				}
		//			}
		//			// JÚµÄ­é±ÆªÅ«é©Ç¤©
		//			if(dp[s & ~(1 << j)] != INF){
		//				dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
		//			}
		//		}
		//	}
		//}
		//cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:40: error: 'score' was not declared in this scope
   20 |                                 cin >> score[i][j];
      |                                        ^~~~~
a.cc:28:38: error: 'score' was not declared in this scope
   28 |                         dp[1 << i] = score[i][0];
      |                                      ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int score[17][17];
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> score[i][j];
			}
		}

	//	fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = score[i][0];
		}
		
		//// ªóÔ©çSÌóÔðvZiQ»®ðpj
		//for(int s = 3; s < (1 << n); s++){
		//	// jrbgÚªtrueÈçAvZ
		//	for(int j = 0; j < n; j++){
		//		if((s >> j) & 1){
		//			int sc = INF;
		//			for(int i = 0; i < n; i++){
		//				if(((s >> i) & 1) && i != j){
		//					sc = min(sc,score[j][i+1]);
		//				}
		//			}
		//			// JÚµÄ­é±ÆªÅ«é©Ç¤©
		//			if(dp[s & ~(1 << j)] != INF){
		//				dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
		//			}
		//		}
		//	}
		//}
		//cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:40: error: 'score' was not declared in this scope
   20 |                                 cin >> score[i][j];
      |                                        ^~~~~
a.cc:28:38: error: 'score' was not declared in this scope
   28 |                         dp[1 << i] = score[i][0];
      |                                      ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int score[17][17];
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> score[i][j];
			}
		}

		//fill(dp,dp+(1<<16),INF);

		//// ÅÉ_WðUª·éê
		//for(int i = 0; i < n; i++){
		//	dp[1 << i] = score[i][0];
		//}
		
		//// ªóÔ©çSÌóÔðvZiQ»®ðpj
		//for(int s = 3; s < (1 << n); s++){
		//	// jrbgÚªtrueÈçAvZ
		//	for(int j = 0; j < n; j++){
		//		if((s >> j) & 1){
		//			int sc = INF;
		//			for(int i = 0; i < n; i++){
		//				if(((s >> i) & 1) && i != j){
		//					sc = min(sc,score[j][i+1]);
		//				}
		//			}
		//			// JÚµÄ­é±ÆªÅ«é©Ç¤©
		//			if(dp[s & ~(1 << j)] != INF){
		//				dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
		//			}
		//		}
		//	}
		//}
		//cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:40: error: 'score' was not declared in this scope
   20 |                                 cin >> score[i][j];
      |                                        ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int score[17][17];
		//for(int i = 0; i < n; i++){
		//	for(int j = 0; j <= n; j++){
		//		cin >> score[i][j];
		//	}
		//}

		fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = score[i][0];
		}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		for(int s = 3; s < (1 << n); s++){
			// jrbgÚªtrueÈçAvZ
			for(int j = 0; j < n; j++){
				if((s >> j) & 1){
					int sc = INF;
					for(int i = 0; i < n; i++){
						if(((s >> i) & 1) && i != j){
							sc = min(sc,score[j][i+1]);
						}
					}
					// JÚµÄ­é±ÆªÅ«é©Ç¤©
					if(dp[s & ~(1 << j)] != INF){
						dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
					}
				}
			}
		}
		cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:28:38: error: 'score' was not declared in this scope
   28 |                         dp[1 << i] = score[i][0];
      |                                      ^~~~~
a.cc:39:69: error: 'score' was not declared in this scope
   39 |                                                         sc = min(sc,score[j][i+1]);
      |                                                                     ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int score[17][17];
		//for(int i = 0; i < n; i++){
		//	for(int j = 0; j <= n; j++){
		//		cin >> score[i][j];
		//	}
		//}

		//fill(dp,dp+(1<<16),INF);

		//// ÅÉ_WðUª·éê
		//for(int i = 0; i < n; i++){
		//	dp[1 << i] = score[i][0];
		//}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		for(int s = 3; s < (1 << n); s++){
			// jrbgÚªtrueÈçAvZ
			for(int j = 0; j < n; j++){
				if((s >> j) & 1){
					int sc = INF;
					for(int i = 0; i < n; i++){
						if(((s >> i) & 1) && i != j){
							sc = min(sc,score[j][i+1]);
						}
					}
					// JÚµÄ­é±ÆªÅ«é©Ç¤©
					if(dp[s & ~(1 << j)] != INF){
						dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
					}
				}
			}
		}
		cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:39:69: error: 'score' was not declared in this scope
   39 |                                                         sc = min(sc,score[j][i+1]);
      |                                                                     ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int score[17][17];
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> score[i][j];
			}
		}

		fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = score[i][0];
		}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		//for(int s = 3; s < (1 << n); s++){
		//	// jrbgÚªtrueÈçAvZ
		//	for(int j = 0; j < n; j++){
		//		if((s >> j) & 1){
		//			int sc = INF;
		//			for(int i = 0; i < n; i++){
		//				if(((s >> i) & 1) && i != j){
		//					sc = min(sc,score[j][i+1]);
		//				}
		//			}
		//			// JÚµÄ­é±ÆªÅ«é©Ç¤©
		//			if(dp[s & ~(1 << j)] != INF){
		//				dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
		//			}
		//		}
		//	}
		//}
		//cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:40: error: 'score' was not declared in this scope
   20 |                                 cin >> score[i][j];
      |                                        ^~~~~
a.cc:28:38: error: 'score' was not declared in this scope
   28 |                         dp[1 << i] = score[i][0];
      |                                      ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int score[17][17];
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> score[i][j];
			}
		}

		//fill(dp,dp+(1<<16),INF);

		//// ÅÉ_WðUª·éê
		//for(int i = 0; i < n; i++){
		//	dp[1 << i] = score[i][0];
		//}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		//for(int s = 3; s < (1 << n); s++){
		//	// jrbgÚªtrueÈçAvZ
		//	for(int j = 0; j < n; j++){
		//		if((s >> j) & 1){
		//			int sc = INF;
		//			for(int i = 0; i < n; i++){
		//				if(((s >> i) & 1) && i != j){
		//					sc = min(sc,score[j][i+1]);
		//				}
		//			}
		//			// JÚµÄ­é±ÆªÅ«é©Ç¤©
		//			if(dp[s & ~(1 << j)] != INF){
		//				dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
		//			}
		//		}
		//	}
		//}
		//cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:40: error: 'score' was not declared in this scope
   20 |                                 cin >> score[i][j];
      |                                        ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		int scores[17][17];
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> scores[i][j];
			}
		}

		fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = scores[i][0];
		}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		for(int s = 3; s < (1 << n); s++){
			// jrbgÚªtrueÈçAvZ
			for(int j = 0; j < n; j++){
				if((s >> j) & 1){
					int sc = INF;
					for(int i = 0; i < n; i++){
						if(((s >> i) & 1) && i != j){
							sc = min(sc,scores[j][i+1]);
						}
					}
					// JÚµÄ­é±ÆªÅ«é©Ç¤©
					if(dp[s & ~(1 << j)] != INF){
						dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
					}
				}
			}
		}
		cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:40: error: 'scores' was not declared in this scope
   20 |                                 cin >> scores[i][j];
      |                                        ^~~~~~
a.cc:28:38: error: 'scores' was not declared in this scope
   28 |                         dp[1 << i] = scores[i][0];
      |                                      ^~~~~~
a.cc:39:69: error: 'scores' was not declared in this scope
   39 |                                                         sc = min(sc,scores[j][i+1]);
      |                                                                     ^~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int INF = 10000000;

//  éðóÔÅà¯éÅ¬Ô
int dp[1 << 16];

int n;

void solve(){

	int scores[17][17];
	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> scores[i][j];
			}
		}

		fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = scores[i][0];
		}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		for(int s = 3; s < (1 << n); s++){
			// jrbgÚªtrueÈçAvZ
			for(int j = 0; j < n; j++){
				if((s >> j) & 1){
					int sc = INF;
					for(int i = 0; i < n; i++){
						if(((s >> i) & 1) && i != j){
							sc = min(sc,scores[j][i+1]);
						}
					}
					// JÚµÄ­é±ÆªÅ«é©Ç¤©
					if(dp[s & ~(1 << j)] != INF){
						dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
					}
				}
			}
		}
		cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:47: error: 'i' was not declared in this scope
   20 |                                 cin >> scores[i][j];
      |                                               ^
a.cc: At global scope:
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int INF = 10000000;


void solve(){

	//  éðóÔÅà¯éÅ¬Ô
	int dp[1 << 16];
	int n;
	int scores[17][17];
	while(cin >> n && n != 0){
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> scores[i][j];
			}
		}

		fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = scores[i][0];
		}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		for(int s = 3; s < (1 << n); s++){
			// jrbgÚªtrueÈçAvZ
			for(int j = 0; j < n; j++){
				if((s >> j) & 1){
					int sc = INF;
					for(int i = 0; i < n; i++){
						if(((s >> i) & 1) && i != j){
							sc = min(sc,scores[j][i+1]);
						}
					}
					// JÚµÄ­é±ÆªÅ«é©Ç¤©
					if(dp[s & ~(1 << j)] != INF){
						dp[s] = min(dp[s],dp[s & ~(1 << j)] + sc);
					}
				}
			}
		}
		cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:47: error: 'i' was not declared in this scope
   20 |                                 cin >> scores[i][j];
      |                                               ^
a.cc: At global scope:
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int INF = 2000000000;


void solve(){

	//  éðóÔÅà¯éÅ¬Ô
	int n;
	while(cin >> n && n != 0){
		int dp[1 << 16];
		int scores[17][17];
		// iÔÌ_WÍjÔÌACeðg¤±ÆÉæÁÄscore[i][j]bÅð­±ÆªÂ\
		for(int i = 0; i < n; i++){
			for(int j = 0; j <= n; j++){
				cin >> scores[i][j];
			}
		}

		fill(dp,dp+(1<<16),INF);

		// ÅÉ_WðUª·éê
		for(int i = 0; i < n; i++){
			dp[1 << i] = scores[i][0];
		}
		
		// ªóÔ©çSÌóÔðvZiQ»®ðpj
		for(int s = 3; s < (1 << n); s++){
			// jrbgÚªtrueÈçAvZ
			for(int j = 0; j < n; j++){
				if((s >> j) & 1){
					int sc = scores[j][0];
					for(int i = 0; i < n; i++){
						if(((s >> i) & 1) && i != j){
							sc = min(sc,scores[j][i+1]);
						}
					}
					// JÚµÄ­é±ÆªÅ«é©Ç¤©
					if(dp[(s & ~(1 << j))] != INF){
						dp[s] = min(dp[s],dp[(s & ~(1 << j))] + sc);
					}
				}
			}
		}
		cout << dp[(1 << n) - 1] << endl;
	}
}

int main(){
	
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:47: error: 'i' was not declared in this scope
   20 |                                 cin >> scores[i][j];
      |                                               ^
a.cc:24:22: error: 'dp' was not declared in this scope
   24 |                 fill(dp,dp+(1<<16),INF);
      |                      ^~
a.cc:28:38: error: 'scores' was not declared in this scope
   28 |                         dp[1 << i] = scores[i][0];
      |                                      ^~~~~~
a.cc:36:50: error: 'scores' was not declared in this scope
   36 |                                         int sc = scores[j][0];
      |                                                  ^~~~~~
a.cc: At global scope:
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

100 100 60 60 70 70 70 90
100 50 100 55 45 45 55 44
100 50 60 100 51 50 55 30
100 70 10 20 1 10 10 40
200 90 10 30 10 10 10 30
150 200 12 1 11 11 1 30
10000 1200 1100 1100 1200 1200 1090 1
0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 100 100 60 60 70 70 70 90
      | ^~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;
int dp[1<<17][17];
	int INF = 1<<28;
	int ts[17][17];
    int n;
	  int tsp(int S, int v) {
        if (dp[S][v] >= 0) {
            return dp[S][v];
        }
        int min = ts[v][0];
        for (int i = 1; i <= n; i++) {
            if (i == v)
                continue;
            if ((S >> i & 1) == 1) {
                min = std::min(min, ts[v][i]);
            }
        }
        if (S == (1 << (n + 1)) - 1) {
            return dp[S][v] = min;
        }
        int res = INF;
        for (int u = 1; u <= n; u++) {
            if ((S & (1 << u)) == 0) {
 
                res = std::min(res, tsp(S | 1 << u, u) + min);
            }
        }
        return dp[S][v] = res;
    }
int main(){
	
        while (cin >> n) {
            if (n == 0)
                break;
            for (int i = 1; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    cin >> ts[i][j];
                }
            }
            int min = INF;
            for (int i = 1; i <= n; i++) {
                for (int j = 0; j < 1 << (n + 1); j++) {
                    memset(dp[j],-1,sizeof(dp[j]));
                }
                min = std::min(min, tsp(1 | 1 << i, i));
            }
            cout << min;
        }
    }
 
  

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

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

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

int n;
vector<vector<int> > t;
int memo[(1 << 16)];

int dfs(int cleared) {
	if(cleared == (1 << n) - 1)
		return 0;

	if(memo[cleared] != -1)
		return memo[cleared];

	int res = INT_MAX;
	for(int i = 0; i < n; ++i) {
		if(!(cleared & (1 << i))) {
			const int next = cleared | (1 << i);
			chmin(res, dfs(next) + t[i][0]);

			for(int j = 0; j < n; ++j)
				if(cleared & (1 << j))
					chmin(res, dfs(next) + t[i][j + 1]);
		}
	}

	return memo[cleared] = res;
}

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

	while(cin >> n, n) {
		t.clear();
		t.resize(n, vector<int>(n + 1));
		for(int i = 0; i < n; ++i)
			for(int j = 0; j < n + 1; ++j)
				cin >> t[i][j];

		memset(memo, -1, sizeof(memo));
		cout << dfs(0) << endl;
	}

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:20:19: error: 'INT_MAX' was not declared in this scope
   20 |         int res = INT_MAX;
      |                   ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

#define MAX (1<<16)
#define INF (INT_MAX/4)

int dp[MAX+1];
int t[16][17];

int main() {
  int n;
  
  while(cin >> n && n) {
    for(int i=0; i<n; i++)
      for(int j=0; j<n+1; j++)
	cin >> t[i][j];
    
    fill(dp, dp+(1<<n), INF);
    
    dp[0] = 0;
    for(int i=0; i<(1<<n); i++) {
      for(int j=0; j<n; j++) {
	if( !(i>>j & 1) ) {
	  // bare hands
	  dp[i|(1<<j)] = min(dp[i|(1<<j)], dp[i]+t[j][0]);
	  for(int k=0; k<n; k++) {
	    if( i>>k & 1 )
	      dp[i|(1<<j)] = min(dp[i|(1<<j)], dp[i]+t[j][k+1]);
	  }
	}
      }
    }
    
    cout << dp[(1<<n)-1] << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'INT_MAX' was not declared in this scope
    7 | #define INF (INT_MAX/4)
      |              ^~~~~~~
a.cc:20:25: note: in expansion of macro 'INF'
   20 |     fill(dp, dp+(1<<n), INF);
      |                         ^~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 |
Language: C++

#include <iostream>
#include <string>
#include <set>

using namespace std;

const int N = 200;
bool ok[N][N];
set<int> dp[N][N];



string s;
set<int> calc(int l, int r){
	if (ok[l][r]) return dp[l][r];
	ok[l][r] = 1;
	auto &res = dp[l][r];

	int nest = 0;
	bool ope = false;
	for (int i = l; i < r; ++i){
		if (s[i] == '(') ++nest;
		else if (s[i] == ')') --nest;
		else if (!nest && s[i] < '0' || s[i] > '9'){
			ope = true;
			auto L = calc(l, i), R = calc(i+1, r);
			for (auto e1 : L){
				for (auto e2 : R){
					if (s[i] == '+') res.insert(e1 + e2);
					if (s[i] == '-') res.insert(e1 - e2);
					if (s[i] == '*') res.insert(e1 * e2);
					if (s[i] == '/' && e2) res.insert(e1 / e2);
				}
			}
		}
	}

	if (!ope){
		if (s[l] == '(' && s[r - 1] == ')') res = calc(l + 1, r - 1);
		else res.insert(stoi(s.substr(l, r - l)));
	}
	return res;
}

int main(){
	while (cin >> s, s != "#"){
		int n = s.size();
		memset(ok, 0, sizeof(ok));
		for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j) dp[i][j].clear();
		cout << calc(0, n).size() << endl;
	}

	return 0;
}

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

#include <iostream>
#include <set>
#include <sstream>
 
using namespace std;
 
set<int> m1[201][201];
bool m2[201][201];
 
int stoi(string s) {
	stringstream ss; ss << s;
	int ret; ss >> ret;
	return ret;
}
 
string str;
set<int> dp(int l, int r) {
	if (m2[l][r]) return m1[l][r];
  if (m2[l][r]) return m1[l][r];
  int cnt = 0; bool p = true; set<int> res;
  for (int i = l; i < r; ++i) {
    char c = str[i];
    if (c == '(') ++cnt;
    else if (c == ')') --cnt;
    else if (cnt == 0 && !isdigit(c)) {
      p = false;
      set<int> s1 = dp(l, i), s2 = dp(i+1, r);
      for (int j: s1) for (int k: s2) {
        if (c == '+') res.insert(j + k);
        if (c == '-') res.insert(j - k);
        if (c == '*') res.insert(j * k);
        if (k && str[i] == '/') res.insert(j / k);
      }
    }
  }
  if (p) {
    if (str[l] == '(' && str[r-1] == ')') res = dp(l+1, r-1);
    else res.insert(stoi(str.substr(l, r-l)));
  }
  m2[l][r] = true; return m1[l][r] = res;
}
 
int main() {
	while (cin >> str, str != "#") {
		fill(&m2[0][0], &m2[0][0]+201*201, false);
		cout << dp(0, str.size()).size() << endl;
	}
}

Compiler output:
a.cc: In function 'std::set<int> dp(int, int)':
a.cc:38:25: error: call of overloaded 'stoi(std::__cxx11::basic_string<char>)' is ambiguous
   38 |     else res.insert(stoi(str.substr(l, r-l)));
      |                     ~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:10:5: note: candidate: 'int stoi(std::string)'
   10 | int stoi(string s) {
      |     ^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
Language: C++

#include <iostream>
#include <set>
#include <vector>

using namespace std;

#define MP make_pair

typedef pair<int, int> PII;

const int SIZE = 15;

char line[SIZE], t[SIZE];
set<int> memo[SIZE][SIZE];
set<PII> used;
 
void eval(int const l, int const r) {
   
  set<int>& ret = memo[l][r];
  if(l == r) return;
   
  if(used.count(MP(l, r))) return;
  used.insert(MP(l, r));
   
  // check is digits [l, r)
  bool digits = true;
  for(int i=l; i<r; i++) { digits = digits && isdigit(line[i]); }
  strncpy(t, line+l, r-l); t[r-l+1] = 0;
  if(digits) { ret.insert(atoi(t)); return; }
   
  int par = 0; bool check = true;
  for(int i=l; i<r-1; i++) {
    if(line[i] == '(') { par ++; }
    if(line[i] == ')') { par --; }
    if(par == 0) { check = false; }
  }
   
  // "(expr)"
  if(check) {
    if(line[r-1] == ')') {
      eval(l+1, r-1); ret = memo[l+1][r-1]; return;
    }
  }
   
  par = 0;
  // parsing loop
  for(int i=l; i<r; i++) {
    if(line[i] == '(') { par ++; }
    if(line[i] == ')') { par --; }
    if(par != 0) continue;
     
    switch(line[i]) {
    case '+': case '-': case '*': case '/': {
      eval(l, i); eval(i+1, r);
      set<int>::iterator iter_a, iter_b;
      for(iter_a = memo[l][i].begin(); iter_a!=memo[l][i].end(); iter_a++) {
        for(iter_b = memo[i+1][r].begin(); iter_b!=memo[i+1][r].end(); iter_b++) {
          if(line[i] == '+') { ret.insert(*iter_a + *iter_b); }
          if(line[i] == '-') { ret.insert(*iter_a - *iter_b); }
          if(line[i] == '*') { ret.insert(*iter_a * *iter_b); }
          if(line[i] == '/') {
            if(*iter_b == 0) continue;
            ret.insert(*iter_a / *iter_b);
          }
        }
      }
      break;
    }
    default:;
    }
  } // for parsing loop
}
 
int main() {
   
  while(1) {
    scanf("%s\n", line);
    for(int i=0; i<SIZE; i++)
      for(int j=0; j<SIZE; j++)
        memo[i][j].clear();
     
    used.clear();
     
    if(0==strcmp(line, "#")) break;
    eval(0, strlen(line));
    cout << memo[0][strlen(line)].size() << endl;
  }
   
  return 0;
}

Compiler output:
a.cc: In function 'void eval(int, int)':
a.cc:28:3: error: 'strncpy' was not declared in this scope
   28 |   strncpy(t, line+l, r-l); t[r-l+1] = 0;
      |   ^~~~~~~
a.cc:4:1: note: 'strncpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | 
a.cc: In function 'int main()':
a.cc:84:11: error: 'strcmp' was not declared in this scope
   84 |     if(0==strcmp(line, "#")) break;
      |           ^~~~~~
a.cc:84:11: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:85:13: error: 'strlen' was not declared in this scope
   85 |     eval(0, strlen(line));
      |             ^~~~~~
a.cc:85:13: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Divide_the_Cake {
	public static void main(String[] args) {
		new Divide_the_Cake().solver();
	}

	void solver() {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int w = sc.nextInt(), h = sc.nextInt(), n = sc.nextInt();
			if (w == 0 && h == 0 && n == 0)
				break;
			n *= 2;
			double[] x = new double[n + 2];
			double[] y = new double[n + 2];
			for (int i = 0; i < n; i++) {
				x[i] = sc.nextDouble();
				y[i] = sc.nextDouble();
			}
			x[n] = w;
			y[n] = 0;
			x[n + 1] = w;
			y[n + 1] = h;
			ArrayList<Double> y1 = new ArrayList<>();
			for (int i = 0; i < n + 2; i++) {
				for (int j = i + 1; j < n + 2; j++) {
					if (x[i] != x[j]) {
						double tmp = (y[i] - y[j]) / (x[i] - x[j]) * (-x[i]) + y[i];
						if (0 < tmp && tmp < h)
							y1.add(tmp);
					}
				}
			}
			y1.add(0.0);
			y1.add((double) h);
			y1.sort(null);
			for (int i = 0; i < y1.size() - 1; i++) {
				while (i < y1.size() - 1 && y1.get(i) == y1.get(i + 1)) {
					y1.remove(i);
				}
			}

			double ans = 0;
			double[] y2 = new double[n];

			for (int i = 0; i < y1.size() - 1; i++) {
				double y_mid = (y1.get(i) + y1.get(i + 1)) / 2;
				for (int j = 0; j < n; j++) {
					double tmp;
					if (x[j] == 0)
						tmp = 1L << 30;
					else
						tmp = (y[j] - y_mid) / (x[j] - 0) * (w - x[j]) + y[j];
					if (tmp < 0)
						tmp = 0;
					if (tmp > h)
						tmp = h;
					y2[j] = tmp;
				}
				Arrays.sort(y2);
				ans += (y2[n / 2] - y2[n / 2 - 1]) * (y1.get(i + 1) - y1.get(i));
			}
			System.out.println(ans / (h * h));
		}
	}
}

Compiler output:
Main.java:5: error: class Divide_the_Cake is public, should be declared in a file named Divide_the_Cake.java
public class Divide_the_Cake {
       ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Divide_the_Cake {
	public static void main(String[] args) {
		new Divide_the_Cake().solver();
	}

	double EPS = 1e-11;

	void solver() {
		Scanner sc = new Scanner(System.in);
		while (true) {
			double w = sc.nextDouble(), h = sc.nextDouble();
			int n = sc.nextInt();
			if (w == 0 && h == 0 && n == 0)
				break;
			n *= 2;
			double[] x = new double[n + 2];
			double[] y = new double[n + 2];
			for (int i = 0; i < n; i++) {
				x[i] = sc.nextDouble();
				y[i] = sc.nextDouble();
			}
			x[n] = w;
			y[n] = 0;
			x[n + 1] = w;
			y[n + 1] = h;
			ArrayList<Double> y1 = new ArrayList<>();
			for (int i = 0; i < n + 2; i++) {
				for (int j = i + 1; j < n + 2; j++) {
					if (x[i] != x[j]) {
						double tmp = (y[i] - y[j]) / (x[i] - x[j]) * (-x[j]) + y[j];
						if (0 < tmp && tmp < h)
							y1.add(tmp);
					}
				}
			}
			y1.add(0.0);
			y1.add(h);
			y1.sort(null);
			for (int i = 0; i < y1.size() - 1; i++) {
				while (i < y1.size() - 1 && y1.get(i) == y1.get(i + 1)) {
					y1.remove(i);
				}
			}

			double ans = 0;

			for (int i = 0; i < y1.size() - 1; i++) {
				double[] y2 = new double[n];
				if (Math.abs(y1.get(i) - y1.get(i + 1)) < EPS)
					continue;
				double y_mid = (y1.get(i) + y1.get(i + 1)) / 2;
				for (int j = 0; j < n; j++) {
					double tmp = (y[j] - y_mid) / ((x[j] + EPS) - 0) * w + y_mid;
					if (tmp < 0)
						tmp = 0;
					if (tmp > h)
						tmp = h;
					y2[j] = tmp;
				}
				Arrays.sort(y2);
				ans += (y2[n / 2] - y2[n / 2 - 1]) * (y1.get(i + 1) - y1.get(i));
				// System.out.println(ans / (h * h));
			}
			System.out.println(ans / (h * h));
		}
	}

	void tr(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
}

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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;

int W, H, N;
double x[210];
double y[210];

long double f(double h) {
    vector<double> v;
    REP(i, 2*N) {
        if(x[i] != 0) {
            double dy = (y[i] - h) / x[i];
            double p = h + dy * W;
            if(p < 0) p = 0;
            if(p > H) p = H;
            v.push_back(p);
        } else {
            if(h >= y[i]) {
                v.push_back(0);
            } else {
                v.push_back(H);
            }
        }
    }
    sort(v.begin(), v.end());
    double len = (v[N] - v[N-1]);
    return len / H;
}

// 区間[l, r]をN分割し、各区間を2次関数に近似する
// 計算時間: O(N * f(x))
double simpson(double l, double r, int N, double f(double)){
    double h = (r - l) / (2 * N); 
    long double S = f(l) + f(r);
    for(int i = 1; i < 2 * N; i += 2){
        S += 4.0 * f(l + h * i);
    }
    for(int i = 2; i < 2 * N; i += 2){
        S += 2.0 * f(l + h * i);
    }
    return S * h / 3.0;
}

int main(){
    while(cin >> W >> H >> N && W > 0) {
        REP(i, 2 * N) cin >> x[i] >> y[i];
        const int N = 10000;
        printf("%.12f\n", simpson(0, H, N, f)/H);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:44: error: invalid conversion from 'long double (*)(double)' to 'double (*)(double)' [-fpermissive]
   50 |         printf("%.12f\n", simpson(0, H, N, f)/H);
      |                                            ^
      |                                            |
      |                                            long double (*)(double)
a.cc:34:50: note:   initializing argument 4 of 'double simpson(double, double, int, double (*)(double))'
   34 | double simpson(double l, double r, int N, double f(double)){
      |                                           ~~~~~~~^~~~~~~~~
Language: C++

#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<vector>
using namespace std;
double x[210];
double y[210];
double ABS(double a){return max(a,-a);}
double EPS=1e-9;
double PI=acos(-1.0);
double th[210];
int main(){
	int w,h,a;
	while(scanf("%d%d%d",&w,&h,&a),a){
		for(int i=0;i<2*a;i++)scanf("%lf%lf",x+i,y+i);
		x[2*a]=w;
		y[2*a]=0;
		x[2*a+1]=w;
		y[2*a+1]=h;
		vector<double>v;
		for(int i=0;i<2*a+2;i++)for(int j=i+1;j<2*a+2;j++){
			if(ABS(x[i]-x[j])<EPS)continue;
			double tmp=y[i]-x[i]*(y[i]-y[j])/(x[i]-x[j]);
			if(tmp<0||tmp>h)continue;
			v.push_back(tmp);
		}
		v.push_back(0);
		v.push_back(h);
		std::sort(v.begin(),v.end());
		double ret=0;
		for(int i=0;i<v.size()-1;i++){
			if(v[i+1]-v[i]<EPS)continue;
			double M=(v[i]+v[i+1])/2;
			for(int j=0;j<2*a+2;j++)th[j]=atan2(y[j]-M,x[j]);
			std::sort(th,th+2*a+2);
			if(th[a]<-PI/2+EPS)th[a]+=EPS;
			if(th[a+1]<-PI/2+EPS)th[a+1]+=EPS;
			if(th[a]>PI/2-EPS)th[a]-=EPS;
			if(th[a+1]>PI/2-EPS)th[a+1]-=EPS;
			
			double L=max(0.0,M+w*tan(th[a]));
			double R=min((double)h,M+w*tan(th[a+1]));
			ret+=max(0.0,R-L)*(v[i+1]-v[i]);
		}
		printf("%.12f\n",ret/h/h);
	}

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