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

#include <iostream>
using namespace std;
#define REP(i,n) for(i=1;i<=n;i++)
short x,y,w[505][505];char map[505][505];int main(){int i,j,k;while(cin>>y>>x,y){REP(i,y)cin>>map[i]+1;memset(w,0,sizeof(w));REP(i,y)REP(j,x)w[i][j]=x-j+1;REP(i,y)REP(j,x)if(map[i][j]=='.')continue;else for(k=j;k>0;k--)if(w[i][k]>j-k)w[i][k]=j-k;int max=0;REP(i,y)REP(j,x){int h=1;if(!w[i][j])continue;for(k=i-1;w[k][j]>=w[i][j];k--)h++;for(k=i+1;w[k][j]>=w[i][j];k++)h++;if(max<w[i][j]*h)max=w[i][j]*h;}cout<<max<<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:104: error: 'memset' was not declared in this scope
    4 | short x,y,w[505][505];char map[505][505];int main(){int i,j,k;while(cin>>y>>x,y){REP(i,y)cin>>map[i]+1;memset(w,0,sizeof(w));REP(i,y)REP(j,x)w[i][j]=x-j+1;REP(i,y)REP(j,x)if(map[i][j]=='.')continue;else for(k=j;k>0;k--)if(w[i][k]>j-k)w[i][k]=j-k;int max=0;REP(i,y)REP(j,x){int h=1;if(!w[i][j])continue;for(k=i-1;w[k][j]>=w[i][j];k--)h++;for(k=i+1;w[k][j]>=w[i][j];k++)h++;if(max<w[i][j]*h)max=w[i][j]*h;}cout<<max<<endl;}}
      |                                                                                                        ^~~~~~
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 <iostream>
#include <stdlib.h>
using namespace std;
#define REP(i,n) for(i=1;i<=n;i++)
short x,y,w[505][505];char map[505][505];int main(){int i,j,k;while(cin>>y>>x,y){REP(i,y)cin>>map[i]+1;memset(w,0,sizeof(w));REP(i,y)REP(j,x)w[i][j]=x-j+1;REP(i,y)REP(j,x)if(map[i][j]=='.')continue;else for(k=j;k>0;k--)if(w[i][k]>j-k)w[i][k]=j-k;int max=0;REP(i,y)REP(j,x){int h=1;if(!w[i][j])continue;for(k=i-1;w[k][j]>=w[i][j];k--)h++;for(k=i+1;w[k][j]>=w[i][j];k++)h++;if(max<w[i][j]*h)max=w[i][j]*h;}cout<<max<<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:104: error: 'memset' was not declared in this scope
    5 | short x,y,w[505][505];char map[505][505];int main(){int i,j,k;while(cin>>y>>x,y){REP(i,y)cin>>map[i]+1;memset(w,0,sizeof(w));REP(i,y)REP(j,x)w[i][j]=x-j+1;REP(i,y)REP(j,x)if(map[i][j]=='.')continue;else for(k=j;k>0;k--)if(w[i][k]>j-k)w[i][k]=j-k;int max=0;REP(i,y)REP(j,x){int h=1;if(!w[i][j])continue;for(k=i-1;w[k][j]>=w[i][j];k--)h++;for(k=i+1;w[k][j]>=w[i][j];k++)h++;if(max<w[i][j]*h)max=w[i][j]*h;}cout<<max<<endl;}}
      |                                                                                                        ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <stdlib.h>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

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

int h,w;
char m[512][512];

int AboveHeight(int x,int y)
{
	int res=0;
	while(m[y][x]=='.')
	{
		++res;
		--y;
	}
	return res;
}

int Solve(int y)
{
	typedef pair<int,int>P;
	int res=0, x;
	stack<P> s;
	for(x=1; x<=w+1; ++x)
	{
		int a=AboveHeight(x,y);
		if(s.empty() || s.top().first <= a)
			s.push(P(a,x));
		else
		{
			int lastX = -1;
			while(!s.empty() && s.top().first > a)
			{
				P p=s.top();
				s.pop();
				res = max(res, p.first * (x-p.second));
				lastX = p.second;
			}
			s.push(P(a,lastX));
		}
	}
	return res;
}

int main()
{
	while(scanf("%d%d",&h,&w),h)
	{
		memset(m,'*',sizeof(m));
		int x,y;
		int res=0;
		for(y=1; y<=h; ++y)
			scanf("%s",&m[y][1]);
		for(y=1; y<=h; ++y)
			res=max(res,Solve(y));
		printf("%d\n",res);
	}
	return 0;
}

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

while True:
    H,W = map(int, raw_input().split(" "))
    if (H,W) == (0,0):
        break
    field = [raw_input() for _ in xrange(H)]
    space = [[0]*(W+1) for _ in xrange(H)]
    for x in xrange(W-1,-1,-1):
        for y in xrange(H):
            if field[y][x]==".":
                space[y][x] = space[y][x+1]+1 
    ans = 0
    for x in xrange(W):
        for y in (yy for yy in xrange(H) if field[y][x] == "."):
            for hh in xrange(y+1,H+1):
                ans = max(ans, min(s[x] for s in space[y:h])*(h-y))
    print ans

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while True:
      | ^~~~~
Language: C++

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

int main(){

  int h, w;
  string s[999];
  int data[999][999];

  while(true){
    cin >> h >> w;
    if(!h && !w) break;

    for(int i=0;i<h;i++) cin >> s[i];

    for(int i=0;i<h;i++){
      int k = 0;
      for(int j=w-1;j>=0;j--){
	data[i][j] = ++k;
	if(s[i][j] == '*') data[i][j] = k = 0;
      }
    }#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){

  int h, w;
  string s[999];
  int data[999][999];

  while(true){
    cin >> h >> w;
    if(!h && !w) break;

    for(int i=0;i<h;i++) cin >> s[i];

    for(int i=0;i<h;i++){
      int k = 0;
      for(int j=w-1;j>=0;j--){
	data[i][j] = ++k;
	if(s[i][j] == '*') data[i][j] = k = 0;
      }
    }

    int ans = 0;
    for(int j=0;j<w;j++){
      for(int i=0;i<h;i++){
	int p = data[i][j];
	for(int k=i,l=1;k<h;k++,l++){
	  p = min(p, data[k][j]);
	  ans = max(ans, p * l);
	}
      }
    }

    cout << ans << endl;
  }
}


    int ans = 0;
    for(int j=0;j<w;j++){
      for(int i=0;i<h;i++){
	int p = data[i][j];
	for(int k=i,l=1;k<h;k++,l++){
	  p = min(p, data[k][j]);
	  ans = max(ans, p * l);
	}
      }
    }

    cout << ans << endl;
  }
}

Compiler output:
a.cc:24:6: error: stray '#' in program
   24 |     }#include<iostream>
      |      ^
a.cc: In function 'int main()':
a.cc:24:7: error: 'include' was not declared in this scope
   24 |     }#include<iostream>
      |       ^~~~~~~
a.cc:24:23: error: expected primary-expression before '>' token
   24 |     }#include<iostream>
      |                       ^
a.cc:27:1: error: expected primary-expression before 'using'
   27 | using namespace std;
      | ^~~~~
a.cc:29:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   29 | int main(){
      |         ^~
a.cc:29:9: note: remove parentheses to default-initialize a variable
   29 | int main(){
      |         ^~
      |         --
a.cc:29:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:29:11: error: a function-definition is not allowed here before '{' token
   29 | int main(){
      |           ^
Language: Java

#include<iostream>
using namespace std;

static const int INF = 1<<21;
int n, m, a, b, c, d, s, g, v, p;
int mat[21][21];

void floyd(){
    for(int k = 1; k <= n; k++){
        for(int i = 1; i <= n; i++){
            for(int j = 1; j <= n; j++){
                mat[i][j] = min(mat[i][j], mat[i][k]+mat[k][j]);
            }
        }
    }
}

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

    for(int i = 0; i < 21; i++){
        for(int j = 0; j < 21; j++){
            mat[i][j] = INF;
        }
    }

    for(int i = 0; i < m; i++){
        scanf("%d,%d,%d,%d", &a, &b, &c, &d);
        mat[a][b] = c;
        mat[b][a] = d;
    }
    
    scanf("%d,%d,%d,%d", &s, &g, &v, &p);

    floyd();

    printf("%d\n", v-(mat[s][g]+mat[g][s]+p));

    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include<iostream>
        ^
Main.java:4: error: class, interface, enum, or record expected
static const int INF = 1<<21;
       ^
Main.java:5: error: class, interface, enum, or record expected
int n, m, a, b, c, d, s, g, v, p;
^
Main.java:6: error: class, interface, enum, or record expected
int mat[21][21];
^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
void floyd(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:19: error: illegal start of expression
    scanf("%d", &n);
                ^
Main.java:20: error: illegal start of expression
    scanf("%d", &m);
                ^
Main.java:29: error: illegal start of expression
        scanf("%d,%d,%d,%d", &a, &b, &c, &d);
                             ^
Main.java:29: error: illegal start of expression
        scanf("%d,%d,%d,%d", &a, &b, &c, &d);
                                 ^
Main.java:29: error: illegal start of expression
        scanf("%d,%d,%d,%d", &a, &b, &c, &d);
                                     ^
Main.java:29: error: illegal start of expression
        scanf("%d,%d,%d,%d", &a, &b, &c, &d);
                                         ^
Main.java:34: error: illegal start of expression
    scanf("%d,%d,%d,%d", &s, &g, &v, &p);
                         ^
Main.java:34: error: illegal start of expression
    scanf("%d,%d,%d,%d", &s, &g, &v, &p);
                             ^
Main.java:34: error: illegal start of expression
    scanf("%d,%d,%d,%d", &s, &g, &v, &p);
                                 ^
Main.java:34: error: illegal start of expression
    scanf("%d,%d,%d,%d", &s, &g, &v, &p);
                                     ^
16 errors
Language: Java

import java.util.Arrays;
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
        new Main().run();
    }
	int[][] cost;
	boolean[] visit;
	int[] dist;
	int n;
	public void run(){
		Scanner scan = new Scanner(System.in);
		while(true){
			n = scan.nextInt();
			int m = scan.nextInt();
			cost = new int[n][n];
			for(int i = 0;i < n;i++){
				Arrays.fill(cost[i], 1000000);
			}
			for(int i = 0;i < m;i++){
				String[] str = scan.next().split(",");
				int a = Integer.parseInt(str[0])-1;
				int b = Integer.parseInt(str[1])-1;
				cost[a][b] = Integer.parseInt(str[2]);
				cost[b][a] = Integer.parseInt(str[3]);
			}
			String[] str = scan.next().split(",");
			int[] x = {Integer.parseInt(str[0])-1,Integer.parseInt(str[1])-1};
			int reward = Integer.parseInt(str[2]) - Integer.parseInt(str[3]);
			for(int i = 0;i < 2;i++){
				visit = new boolean[n];
				dist = new int[n];
				Arrays.fill(dist,1000000);
				Arrays.fill(visit,false);
				dijkstra(x[i]);
				reward -= dist[x[(i+1)%2]];
			}
			System.out.println(reward);
		}
	}
	public void dijkstra(int start){
		dist[start] = 0;
		while(true){
			int min = 1000000;
			int next = -1;
			for(int u = 0;u < n;u++){
				if(visit[u]){
					continue;
				}
				dist[u] = Math.min(dist[u],dist[start] + cost[start][u]);
				if(dist[u] < min){
					min = dist[u];
					next = u;
				}
			}
			visit[start] = true;
			start = next;
			if(start == -1){
				break;
			}
		}
	}

Compiler output:
Main.java:62: error: reached end of file while parsing
	}
	 ^
1 error
Language: C

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

#define INF 10000000
#define N 21

#define error(s) do{fprintf(stderr , s); exit(-1);}while(0)

int M[N][N],a[N][N],W[N][N],p[N][N];;

void floyd(void);
void path(int i, int j);

int main(){
	int i,j,n,m,a1,b,c,d,x1,x2,y1,y2;

	for(i = 0 ; i < N ; i++){
		for(j = 1 ; j < N ; j++){
			M[i][j] = 0;
		}
	}
	scanf("%d",&n);
	scanf("%d",&m);

	for(i = 0 ; i < m ; i++){
		scanf("%d,%d,%d,%d",&a1,&b,&c,&d);
		M[a1][b] = c;
		M[b][a1] = d;
	}

	scanf("%d,%d,%d,%d",&x1,&x2,&y1,&y2);

	for(i = 0 ; i < N ; i++){
		for(j = 0 ; j < N ; j++){
			if(i == j){
				a[i][j] = 0;
				W[i][j] = 0;
			}
			else if(M[i][j] == 0){
				a[i][j] = INF;
				W[i][j] = INF;
			}
			else{
				a[i][j] = M[i][j];
				W[i][j] = M[i][j];
			}

			if(W[i][j] != INF){
				p[i][j] = j;
			}
			else{
				p[i][j] = -1;
			}

		}
	}

	floyd();
	path(x1,x2,&y1);
	y1 -= y2;
	path(x2,x1,&y1);

	printf("%d\n",y1);
	return 0;
}

void floyd(void){
	int i , j , k ;
	for(i = 0 ; i < N ; i++){
		for(j = 0 ; j < N ; j++){
			a[i][j] = W[i][j];
		}
	}

	for(k = 0 ; k < N ; k++){
		for(i = 0 ; i < N ; i++){
			for(j = 0 ; j < N ; j++){
				if(a[i][k] + a[k][j] < a[i][j]){
					a[i][j] = a[i][k] + a[k][j];
					p[i][j] = p[i][k];
				}
			}
		}
	}
}

void path(int i, int j ,int *y1){
	int tmp,k = i;
	tmp = k;
	while(p[k][j] != j && p[k][j] != -1){
		k = p[k][j];
		*y1 -= M[tmp][k];
		tmp = k;
	}
	if(p[k][j] == -1)error("No Path");
	*y1 -= M[k][j];
}

Compiler output:
main.c: In function 'main':
main.c:59:9: error: too many arguments to function 'path'
   59 |         path(x1,x2,&y1);
      |         ^~~~
main.c:12:6: note: declared here
   12 | void path(int i, int j);
      |      ^~~~
main.c:61:9: error: too many arguments to function 'path'
   61 |         path(x2,x1,&y1);
      |         ^~~~
main.c:12:6: note: declared here
   12 | void path(int i, int j);
      |      ^~~~
main.c: At top level:
main.c:87:6: error: conflicting types for 'path'; have 'void(int,  int,  int *)'
   87 | void path(int i, int j ,int *y1){
      |      ^~~~
main.c:12:6: note: previous declaration of 'path' with type 'void(int,  int)'
   12 | void path(int i, int j);
      |      ^~~~
Language: C

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

#include<limits.h>


int min( int a ,int b )
{
	return a > b ? b : a ;
}


void in( int move[][ 200 ] ,int next[][ 200 ] ,int *ans ,int m )
{
	int now ,nex ;
	int go ,back ;

	int i ,j ;
	for( i = 0 ; i < m ; ++i )
	{
		scanf( "%d,%d,%d,%d" ,&now ,&nex ,&go ,&back ) ;


		++next[ now ][ 0 ] ;
		++next[ nex ][ 0 ] ;

		next[ now ][ next[ now ][ 0 ] ] =	nex ;
		next[ nex ][ next[ nex ][ 0 ] ] =	now ;


		move[ now ][ nex ] = go ;
		move[ nex ][ now ] = back ;
/*
		go_k[ now ][ nex ] = go ;

		back_k[ nex ][ now ] = back ;
*/
	}
}


int next[ 200 ][ 200 ] ;

int move[ 200 ][ 200 ] ;

bool came[ 200 ][ 200 ] ;


int n ,m ;

int st ,end ;

void search( int *ans ,int kale[][ 200 ] ,int now )
{
	int i ;
	for( i = 1 ; i <= next[ now ][ 0 ] ; ++i )
	{
		if( next[ now ][ i ] != st && came[ now ][ i ] == false )
		{
			came[ now ][ i ] = true ;

			ans[ next[ now ][ i ] ] = min( ans[ now ] + kale[ now ][ next[ now ][ i ] ] ,ans[ next[ now ][ i ] ] ) ;
		
			if( next[ now ][ i ] != end )
			{
				search( ans ,kale ,next[ now ][ i ] ) ;
			}
		}
	}
}


void init( int *ans ,int n )
{
	while( n )
	{
		ans[ n-- ] = INT_MAX ;
	}
}
	


int main()
{
	int kale ,stick ;

	int ans[ 20 + 1 ] ;


	scanf( "%d" ,&n ) ;

	init( ans ,n ) ;


	scanf( "%d" ,&m ) ;

	in( move ,next ,ans ,m ) ;


	scanf( "%d,%d,%d,%d" ,&st ,&end ,&kale ,&stick ) ;

	ans[ st ] = 0 ;
	
	search( ans ,move ,st ) ;

	stick += ans[ end ] ;

	init( ans ,n ) ;


	st += end ;
	end = st - end ;
	st -= end ;


	ans[ st ] = 0 ;

	memset( came ,0 ,sizeof came ) ;

	search( ans ,move ,st ) ;


	printf( "%d\n" ,kale - ( stick + ans[ end ] ) ) ;


	return 0 ;
}

Compiler output:
main.c:46:1: error: unknown type name 'bool'
   46 | bool came[ 200 ][ 200 ] ;
      | ^~~~
main.c:5:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    4 | #include<limits.h>
  +++ |+#include <stdbool.h>
    5 | 
main.c: In function 'search':
main.c:58:67: error: 'false' undeclared (first use in this function)
   58 |                 if( next[ now ][ i ] != st && came[ now ][ i ] == false )
      |                                                                   ^~~~~
main.c:58:67: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:58:67: note: each undeclared identifier is reported only once for each function it appears in
main.c:60:44: error: 'true' undeclared (first use in this function)
   60 |                         came[ now ][ i ] = true ;
      |                                            ^~~~
main.c:60:44: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
struct edge { int to, cost; };
vector<edge> G[21];
int search(int start, int goal)
{
    //first := cost, second := now vertex
    priority_queue<P, vector<P>, greater<P>> que;
    vector<int> dist(21, INF);
    que.push(P(0, start));
    dist[start] = 0;
    while(not que.empty())
    {
        P now = que.top(); que.pop();
        if(now.second == goal) break;
        if(d[now.second] < now.first) continue;
        for(int u = 0; u < G[now.second].size(); u++)
        {
            edge e = G[now.second][u];
            if(now.first + e.cost < dist[e.to])
            {
                dist[e.to] = now.first + e.cost;
                que.push(P(dist[e.to], e.to));
            }
        }
    }
    return dist[goal];
}
int main()
{
    int n, m; cin >> n >> m;
    for(int i = 0; i < m; i++)
    {
        int a, b, c, d;
        scanf("%d,%d,%d,%d", &a, &b, &c, &d);
        G[a].push_back({b, c});
        G[b].push_back({a, d});
    }
    int start, goal, v, p;
    scanf("%d,%d,%d,%d", &start, &goal, &v, &p);
    int ans = v - p;
    int a = search(start, goal);
    int b = search(goal, start);
    cout << ans - a - b << endl;
    return 0;
}




Compiler output:
a.cc: In function 'int search(int, int)':
a.cc:33:12: error: 'd' was not declared in this scope; did you mean 'dy'?
   33 |         if(d[now.second] < now.first) continue;
      |            ^
      |            dy
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>

int n, m, start, goal, money, pole;
int roads[21][21];
int in[4];
std::string input;

int check( int pos, int hbt, unsigned int c ){
	if( pos == goal ) return c;

	unsigned int cost = -1;

	for( int i = 1; i <= m; ++i ){
		if( roads[pos][i] != -1 && !(hbt & 1 << i) ){
			cost = std::min( cost, (unsigned int)check( i, hbt|1<<i, c + roads[pos][i] ) );
		}
	}

	return cost;
}

int main(){
	memset( roads, -1, sizeof( roads ) );

	std::cin >> n >> m;

	for( int i = 0; i < m; ++i ){
		std::cin >> input;

		sscanf( input.c_str(), "%d,%d,%d,%d", in, &in[1], &in[2], &in[3] );

		roads[ in[0] ][ in[1] ] = in[2];
		roads[ in[1] ][ in[0] ] = in[3];
	}

	std::cin >> input;
	sscanf( input.c_str(), "%d,%d,%d,%d", &start, &goal, &money, &pole );

	money -= pole;

	int cost = check( start, 0, 0 );
	std::swap( start, goal );
	cost += check( start, 0, 0 );

	std::cout << money - cost << std::endl;
}

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

#include <iostream>
#include <algorithm>
#define MAX_N 20
#define INF 1e9
using namespace std;

int dp[MAX_N][MAX_N];
int dp[MAX_N][MAX_N];
int n,m;

void warshall_froyd(){
  for(int k=0;k<n;k++){
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++)
        dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
    }
  }
}

int main(){
  cin >> n; 
  cin >> m;
  
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      dp[i][j] = (i==j ? 0 : INF);
      dp[i][j] = (i==j ? 0 : INF);
    }
  }
  
  for(int i=0;i<m;i++){
    int a,b,atob,btoa;
    cin >> a >> b >> atob >> btoa;
    a--; b--;
    dp[a][b] = atob; dp[b][a] = btoa;
  }

  warshall_froyd();
  cin >> start >> goal >> reward >> price;
  cout << reward - dp[start][goal] - price << endl;
  return 0;
}

Compiler output:
a.cc:8:5: error: redefinition of 'int dp [20][20]'
    8 | int dp[MAX_N][MAX_N];
      |     ^~
a.cc:7:5: note: 'int dp [20][20]' previously declared here
    7 | int dp[MAX_N][MAX_N];
      |     ^~
a.cc: In function 'int main()':
a.cc:39:10: error: 'start' was not declared in this scope
   39 |   cin >> start >> goal >> reward >> price;
      |          ^~~~~
a.cc:39:19: error: 'goal' was not declared in this scope
   39 |   cin >> start >> goal >> reward >> price;
      |                   ^~~~
a.cc:39:27: error: 'reward' was not declared in this scope; did you mean 'rewind'?
   39 |   cin >> start >> goal >> reward >> price;
      |                           ^~~~~~
      |                           rewind
a.cc:39:37: error: 'price' was not declared in this scope
   39 |   cin >> start >> goal >> reward >> price;
      |                                     ^~~~~
Language: C++

#include <iostrem>
#include <cstdio>

using namspace  std;
int N, M, A, B, C, D, x1, x2, y1, y2;
int K[32][32];
const int inf =1001001001;

int main(){
  for (int i = 0; i < 32; ++i)
  {
    for (int j = 0; j < 32; ++i)
    {
     K[i][j]= inf;
    }
  }
  scanf("%d%d", &N, &M);
  for(int i=0; i<M; ++i){
    scanf("%d,%d,%d,%d", &A, &B, &C, &D);
    // cerr << "read " << A << " " << B << " " << C << " " << D << endl;
    K[A-1][B-1]=C;
    K[B-1][A-1]=D;
  }


  for (int k=1;k<N;k++){
    for (int i = 1; i < N; i++){
      for (int j = 0; j < N; j++){
        if(K[i][j]>(K[i][k]+K[k][j]){
          K[i][j]=K[i][k]+K[k][j];
        }
      }
    }
  }
  scanf("%d,%d,%d,%d", &x1, &x2, &y1, &y2);

  cerr << y1-K[x1][x2]-y2 <<endl;



}

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

#include <iostrem>
#include <cstdio>

using namspace std;
int N, M, A, B, C, D, x1, x2, y1, y2;
int K[32][32];
const int inf =1001001001;

int main(){
  for (int i = 0; i < 32; ++i)
  {
    for (int j = 0; j < 32; ++i)
    {
     K[i][j]= inf;
    }
  }
  scanf("%d%d", &N, &M);
  for(int i=0; i<M; ++i){
    scanf("%d,%d,%d,%d", &A, &B, &C, &D);
    cerr << "read " << A << " " << B << " " << C << " " << D << endl;
    K[A-1][B-1]=C;
    K[B-1][A-1]=D;
  }


  for (int k=1;k<N;k++){
    for (int i = 1; i < N; i++){
      for (int j = 0; j < N; j++){
        if(K[i][j]>(K[i][k]+K[k][j]){
          K[i][j]=K[i][k]+K[k][j];
        }
      }
    }
  }
  scanf("%d,%d,%d,%d", &x1, &x2, &y1, &y2);

  cerr << y1-K[x1][x2]-y2 <<endl;



}

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

#include <iostream>
#include <cstdio>
using namespace std;
int N, M, A, B, C, D, x1, x2, y1, y2;
int K[32][32];

int mini(int s,int t){
  if(s>t){
    return t;
  }
  return s
}

int main(){
  scanf("%d%d", &N, &M);
  for (int i=0; i<M;++i){
    scanf("%d,%d,%d,%d", &A, &B, &C, &D);
    K[A][B]=C;
    K[B][A]=D;
    // cerr << "read " <<A<<" " << B << " " << C <<" "<< D <<endl;
  }
  for (int i = 1; i < N+1 ; ++i)
  {
    for (int j = 0; j < N+1; ++j)
    {
      for(int k=0;k<N+1;++k)
      {
        K[j][k]=mini(K[j][i]+K[i][k],K[j][k]);
      }
    }
  }
  scanf("%d,%d,%d,%d", &x1, &x2, &y1, &y2);
  cerr << y2-y1-K[x1][x2]<<endl;

}

Compiler output:
a.cc:4:31: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
    4 | int N, M, A, B, C, D, x1, x2, y1, y2;
      |                               ^~
a.cc: In function 'int mini(int, int)':
a.cc:11:11: error: expected ';' before '}' token
   11 |   return s
      |           ^
      |           ;
   12 | }
      | ~
Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;

int main(){
	int cityNum,roadNum;
	int city[20];
	int road[190][2];
	int roadCost[190][2];	//0:0-1 1:1-0

	int i,j;
	int start,goal,money,hashira;
	bool flg;

	cin>>cityNum>>roadNum;
	for(i=0;i<roadNum;i++){
		scanf("%d,%d,%d,%d",&road[i][0],&road[i][1],&roadCost[i][0],&roadCost[i][1]);
		road[i][0]--;road[i][1]--;
	}
	
	scanf("%d,%d,%d,%d",&start,&goal,&money,&hashira);
	start--;goal--;
	
	
	for(i=0;i<cityNum;i++) city[i]=1000000;
	city[start]=0;
	do{
		flg=false;
		for(i=0;i<roadNum;i++){
			for(j=0;j<2;j++){
				if(city[road[i][j]]+roadCost[i][j]<city[road[i][1-j]]){
					city[road[i][1-j]]=city[road[i][j]]+roadCost[i][j];
					flg=true;
				}
			}
		}
	}while(flg);
	
	cout<<money-hashira-road[goal]<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:28: error: invalid operands of types 'int' and 'int [2]' to binary 'operator-'
   39 |         cout<<money-hashira-road[goal]<<endl;
      |               ~~~~~~~~~~~~~^~~~~~~~~~~
      |                    |                 |
      |                    int               int [2]
Language: C++

def show(m,a,b,c,d,x):
    for i in xrange(m):
        x[a[i]-1][b[i]-1] = c[i]
        x[b[i]-1][a[i]-1] = d[i]
    return x

def fw(n,x):
    for r in xrange(n):
        for p in xrange(n):
            for q in xrange(n):
                if x[p][q] > x[p][r] + x[r][q]:
                    x[p][q] = x[p][r] + x[r][q]
    return x

n = int(input())
m = int(input())
a = []
b = []
c = []
d = []
for i in xrange(m):
    e,f,g,h = map(int,raw_input().split(','))
    a.append(e)
    b.append(f)
    c.append(g)
    d.append(h)
x1,x2,y1,y2 = map(int,raw_input().split(','))

k = [[1000000000 for x in xrange(n)] for x in xrange(n)]
for i in xrange(n):
    for j in xrange(n):
        k[i][j] = inf
k = show(m,a,b,c,d,k)
k = fw(n,k)

ans1 = k[x1-1][x2-1]
ans2 = k[x2-1][x1-1]

print int(y1-ans1-y2-ans2)

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def show(m,a,b,c,d,x):
      | ^~~
Language: C++

#include <iostream>
using namespace std;
  
int main(){
    int cost[22][22]={0};
    int n,m,i,j,k,a,b,c,d;
    char cc;
    cin>>n>>m;
    for(i=1;i<=n;i++){
        for(j=1;j<=n;j++){
            cost[i][j] = 1<<28;
        }
    }
    for(i=0;i<m;i++){
        cin>>a>>cc>>b>>cc>>c>>cc>>d;
        cost[a][b]=c;cost[b][a]=d;
    }
    for(k=1;k<=n;k++){
      for(i=1;i<=n;i++)
        for(j=1;j<=n;j++)
            cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
        }
    }
    cin>>a>>cc>>b>>cc>>c>>cc>>d;
    cout << c-d-cost[a][b]-cost[b][a] << endl;
}

Compiler output:
a.cc:24:5: error: 'cin' does not name a type
   24 |     cin>>a>>cc>>b>>cc>>c>>cc>>d;
      |     ^~~
a.cc:25:5: error: 'cout' does not name a type
   25 |     cout << c-d-cost[a][b]-cost[b][a] << endl;
      |     ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
  
int main(){
    int cost[22][22]={0};
    int n,m,i,j,k,a,b,c,d;
    char cc;
    cin>>n>>m;
    for(i=1;i<=n;i++){
        for(j=1;j<=n;j++){
            cost[i][j] = 1<<28;
        }
    }
    for(i=0;i<m;i++){
        cin>>a>>cc>>b>>cc>>c>>cc>>d;
        cost[a][b]=c;cost[b][a]=d;
    }
    for(k=1;k<=n;k++){
      for(i=1;i<=n;i++)
        for(j=1;j<=n;j++)
            cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
    cin>>a>>cc>>b>>cc>>c>>cc>>d;
    cout << c-d-cost[a][b]-cost[b][a] << endl;
}

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

#include <list>
#include <queue>
#include <vector>
#include <algorithm>
#include <functional>
#define INF (1LL << 60)
using namespace std;
bool used[200000]; long long dist[200000];
void dijkstra(int V, int E, int s, vector<pair<int, long long> > X[]) {
	priority_queue<pair<long long, int>, vector<pair<long long, int> >, greater<pair<long long, int> > > Q;
	for (int i = 0; i < V; i++) dist[i] = INF, used[i] = false;
	dist[s] = 0; Q.push(make_pair(0, s));
	int cnt = 0;
	while (!Q.empty()) {
		if (cnt > E) return; // NEGATIVE_CYCLE
		pair<long long, int> p = Q.top(); used[p.second] = true; Q.pop();
		for (int i = 0; i < X[p.second].size(); i++) {
			int to = X[p.second][i].first; long long leng = X[p.second][i].second;
			if (dist[to] > dist[p.second] + leng && !used[to]) {
				dist[to] = dist[p.second] + leng;
				Q.push(make_pair(dist[to], to));
			}
		}
	}
}
int V, E, a, b, c, d, x1, x2, y1, y2; vector<pair<int, int> > G[200000];
int main() {
	scanf("%d%d", &V, &E);
	for(int i = 0; i < E; i++) {
		scanf("%d,%d,%d,%d", &a, &b, &c, &d);
		G[a - 1].push_back(make_pair(b - 1, c));
		G[b - 1].push_back(make_pair(a - 1, c));
	}
	scanf("%d,%d,%d,%d", &x1, &x2, &y1, &y2);
	dijkstra(V, E, x1 - 1, G);
	printf("%d\n", y1 - y2 - dist[x2 - 1]);
}

Compiler output:
a.cc:26:31: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
   26 | int V, E, a, b, c, d, x1, x2, y1, y2; vector<pair<int, int> > G[200000];
      |                               ^~
a.cc: In function 'int main()':
a.cc:28:9: error: 'scanf' was not declared in this scope
   28 |         scanf("%d%d", &V, &E);
      |         ^~~~~
a.cc:35:32: error: cannot convert 'std::vector<std::pair<int, int> >*' to 'std::vector<std::pair<int, long long int> >*'
   35 |         dijkstra(V, E, x1 - 1, G);
      |                                ^
      |                                |
      |                                std::vector<std::pair<int, int> >*
a.cc:9:66: note:   initializing argument 4 of 'void dijkstra(int, int, int, std::vector<std::pair<int, long long int> >*)'
    9 | void dijkstra(int V, int E, int s, vector<pair<int, long long> > X[]) {
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:36:9: error: 'printf' was not declared in this scope
   36 |         printf("%d\n", y1 - y2 - dist[x2 - 1]);
      |         ^~~~~~
a.cc:6:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    5 | #include <functional>
  +++ |+#include <cstdio>
    6 | #define INF (1LL << 60)
Language: C++

#include <list>
#include <queue>
#include <vector>
#include <algorithm>
#include <functional>
#define INF (1LL << 60)
using namespace std;
bool used[200000]; long long dist[200000];
void dijkstra(int V, int E, int s, vector<pair<int, long long> > X[]) {
	priority_queue<pair<long long, int>, vector<pair<long long, int> >, greater<pair<long long, int> > > Q;
	for (int i = 0; i < V; i++) dist[i] = INF, used[i] = false;
	dist[s] = 0; Q.push(make_pair(0, s));
	int cnt = 0;
	while (!Q.empty()) {
		if (cnt > E) return; // NEGATIVE_CYCLE
		pair<long long, int> p = Q.top(); used[p.second] = true; Q.pop();
		for (int i = 0; i < X[p.second].size(); i++) {
			int to = X[p.second][i].first; long long leng = X[p.second][i].second;
			if (dist[to] > dist[p.second] + leng && !used[to]) {
				dist[to] = dist[p.second] + leng;
				Q.push(make_pair(dist[to], to));
			}
		}
	}
}
int V, E, a, b, c, d, f1, f2, g1, g2; vector<pair<int, int> > G[200000];
int main() {
	scanf("%d%d", &V, &E);
	for(int i = 0; i < E; i++) {
		scanf("%d,%d,%d,%d", &a, &b, &c, &d);
		G[a - 1].push_back(make_pair(b - 1, c));
		G[b - 1].push_back(make_pair(a - 1, c));
	}
	scanf("%d,%d,%d,%d", &f1, &f2, &g1, &g2); g1 -= g2;
	dijkstra(V, E, f1 - 1, G); g1 -= dist[f2 - 1];
	dijkstra(V, E, f2 - 1, G); g1 -= dist[f1 - 1];
	printf("%d\n", g1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'scanf' was not declared in this scope
   28 |         scanf("%d%d", &V, &E);
      |         ^~~~~
a.cc:35:32: error: cannot convert 'std::vector<std::pair<int, int> >*' to 'std::vector<std::pair<int, long long int> >*'
   35 |         dijkstra(V, E, f1 - 1, G); g1 -= dist[f2 - 1];
      |                                ^
      |                                |
      |                                std::vector<std::pair<int, int> >*
a.cc:9:66: note:   initializing argument 4 of 'void dijkstra(int, int, int, std::vector<std::pair<int, long long int> >*)'
    9 | void dijkstra(int V, int E, int s, vector<pair<int, long long> > X[]) {
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:36:32: error: cannot convert 'std::vector<std::pair<int, int> >*' to 'std::vector<std::pair<int, long long int> >*'
   36 |         dijkstra(V, E, f2 - 1, G); g1 -= dist[f1 - 1];
      |                                ^
      |                                |
      |                                std::vector<std::pair<int, int> >*
a.cc:9:66: note:   initializing argument 4 of 'void dijkstra(int, int, int, std::vector<std::pair<int, long long int> >*)'
    9 | void dijkstra(int V, int E, int s, vector<pair<int, long long> > X[]) {
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:37:9: error: 'printf' was not declared in this scope
   37 |         printf("%d\n", g1);
      |         ^~~~~~
a.cc:6:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    5 | #include <functional>
  +++ |+#include <cstdio>
    6 | #define INF (1LL << 60)
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n,m;
int place[21][21];
int road[21][21];
int co[21][21];
int maxnum[21],minnum[21];
int serch(int start,int finish,int money,int go,int now)
{
    if(money<0)return 0;
    if(go==1&&start==now)return money;
    if(finish==now)go=1;
    int ans=0;
    for(int i=minnum[now];i<=maxnum[now];i++){
        if(place[now][i]>-1&&co[now][i]<2){
            co[now][i]++;
            ans=max(ans,serch(start,finish,money-place[now][i],go,i,now));
            co[now][i]--;
        }
    }
    return ans;
}
int main() {
    cin>>n>>m;
    char a;
    memset(place,-1,sizeof(place));
    for(int i=1;i<21;i++)minnum[i]=22;
    for(int i=0,num[4];i<m;i++){
        for(int j=0;j<3;j++)cin>>num[j]>>a;
        cin>>num[3];
        place[num[0]][num[1]]=num[2];
        place[num[1]][num[0]]=num[3];
        maxnum[num[0]]=max(maxnum[num[0]],num[1]);
	    maxnum[num[1]]=max(maxnum[num[1]],num[0]);
	    minnum[num[0]]=min(minnum[num[0]],num[1]);
	    minnum[num[1]]=min(minnum[num[1]],num[0]);
    }
    int get[4];
    for(int i=0;i<3;i++)cin>>get[i]>>a;
    cin>>get[3];
    cout<<serch(get[0],get[1],get[2]-get[3],0,get[0])<<endl;
}

Compiler output:
a.cc: In function 'int serch(int, int, int, int, int)':
a.cc:17:30: error: too many arguments to function 'int serch(int, int, int, int, int)'
   17 |             ans=max(ans,serch(start,finish,money-place[now][i],go,i,now));
      |                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:8:5: note: declared here
    8 | int serch(int start,int finish,int money,int go,int now)
      |     ^~~~~
Language: C++

#include<iostream>
#include<algorithm>
#define INF 50000000
using namespace std;

int graf[20][20];
int kyo[20];
bool use[20];

void dijk(int ve, int st) {
	fill(kyo, kyo + ve, INF);
	fill(use, use + ve, false);
	kyo[st - 1] = 0;

	while (1) {
		int v = -1;
		for (int i = 0;i < ve; i++) {
			if (!use[i] && (v == -1 || kyo[i] < kyo[v]))v = i;
		}
		if (v == -1)break;
		use[v] = true;
		for (int i = 0;i < ve;i++) {
			kyo[i] = min(kyo[i], kyo[v] + graf[v][i]]);
		}
	}
	return;
}


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

	for (int i = 0;i < n;i++) {
		for (int j = 0;j < n;j++)graf[i][j] = INF;
	}
	for (int i = 0;i < m;i++) {
		int a, b, c, d;
		scanf("%d,%d,%d,%d", &a, &b, &c, &d);
		graf[a - 1][b - 1] = c;
		graf[b - 1][a - 1] = d;

	}
	int s, g, V, P;
	scanf("%d,%d,%d,%d", &s, &g, &V, &P);
	int m = 0;
	dijk(n, s - 1);
	m += kyo[g - 1];
	dijk(n, g - 1);
	m += kyo[s - 1];
	cout << V - P - m << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dijk(int, int)':
a.cc:23:65: error: expected ')' before ']' token
   23 |                         kyo[i] = min(kyo[i], kyo[v] + graf[v][i]]);
      |                                     ~                           ^
      |                                                                 )
a.cc: In function 'int main()':
a.cc:46:13: error: redeclaration of 'int m'
   46 |         int m = 0;
      |             ^
a.cc:31:16: note: 'int m' previously declared here
   31 |         int n, m;
      |                ^
Language: C++

#if 0
accept?????????
30?????????????????£???

??????????????????????????????????§£???????????£?????????
??????????????????????????????????§£???????????£????????§
??????????????????????§£????????????????????¨????????????

Floyd-Warshall????????¨??????
#endif


#include <iostream>
using namespace std;

int N, M, A, B, C, D, x1, x2, y1, y2;
int K[32][32];
const int inf=1001001001;

int main() {
  long long pay,ans;
  for(int i=0;i<32;i++)
    for(int j=0;j<32;j++)
      K[i][j]=inf;

  scanf("%d%d", &N, &M);
  for (int i=0; i<M; ++i) {
    scanf("%d,%d,%d,%d", &A, &B, &C, &D);
    //cerr << "read " << A <<" "<< B <<" " << C <<" " << D<< endl;
    //?????????
    K[A][B]=C; // A ??? B ????????????C
    K[B][A]=D;// B ??? A ????????????D    
  }
  /*
  for(int i=1;i<N+1;i++){//?????§?????????
    for(int j=1;j<N+1;j++){
      if(K[i][j]==inf){
	cout<<"i"<<" ";
      }else{
	cout<<K[i][j]<<" ";
      }
    }
    cout<<endl;
  }
  */
  for(int k=1;k<N+1;k++){
    for(int i=1;i<N+1;i++){
      for(int j=1;j<N+1;j++){
	if(K[i][j]>K[i][k]+K[k][j]){
	  K[i][j]=K[i][k]+K[k][j];
	}
      }
    }/*
    for(int l=1;l<N+1;l++){//?????§??????2???
    for(int m=1;m<N+1;m++){
      if(K[l][m]==inf){
	cout<<"i"<<" ";
      }else{
	cout<<K[l][m]<<" ";
      }
    }
    cout<<endl;
    } 
    cout<<endl;*/
  }
  scanf("%d,%d,%d,%d", &A, &B, &C, &D);
  pay=K[A][B]+K[B][A];
  ans=C-D-pay;
  cout<<ans<<endl; 
}

Compiler output:
a.cc:3:20: error: extended character £ is not valid in an identifier
    3 | 30?????????????????£???
      |                    ^
a.cc:5:35: error: extended character § is not valid in an identifier
    5 | ??????????????????????????????????§£???????????£?????????
      |                                   ^
a.cc:5:35: error: extended character £ is not valid in an identifier
a.cc:5:48: error: extended character £ is not valid in an identifier
    5 | ??????????????????????????????????§£???????????£?????????
      |                                                ^
a.cc:6:35: error: extended character § is not valid in an identifier
    6 | ??????????????????????????????????§£???????????£????????§
      |                                   ^
a.cc:6:35: error: extended character £ is not valid in an identifier
a.cc:6:48: error: extended character £ is not valid in an identifier
    6 | ??????????????????????????????????§£???????????£????????§
      |                                                ^
a.cc:6:57: error: extended character § is not valid in an identifier
    6 | ??????????????????????????????????§£???????????£????????§
      |                                                         ^
a.cc:7:23: error: extended character § is not valid in an identifier
    7 | ??????????????????????§£????????????????????¨????????????
      |                       ^
a.cc:7:23: error: extended character £ is not valid in an identifier
a.cc:16:31: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
   16 | int N, M, A, B, C, D, x1, x2, y1, y2;
      |                               ^~
Language: C++


#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;


struct edge {
	int cost;
	int to;
};

ll INF = 1000000000;
int N,M,s,g,v,p;
ll d[110];
vector<edge> G[110];

void dijkstra(int s) {
	priority_queue<pl, vector<pl>, greater<pl>> q;
	fill(d, d + N, INF);
	d[s] = 0;
	q.push(pl(0, s));

	while (!q.empty()) {
		pl p = q.top(); q.pop();
		int v = p.second;
		if (d[v] < p.first)continue;
		for (int i = 0; i < G[v].size(); i++) {
			edge e = G[v][i];
			if (d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				q.push(pl(d[e.to], e.to));
			}
		}
	}
}

int main()
{
	ll ans = 0;
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		int a, b, c, d;
		scanf_s("%d,%d,%d,%d", &a, &b, &c, &d);
		a--, b--;
		G[a].push_back({c,b});
		G[b].push_back({d,a});
	}
	scanf_s("%d,%d,%d,%d",&s,&g,&v,&p);
	s--, g--;
	dijkstra(s);
	ans += d[g];
	dijkstra(g);
	ans += d[s];
	cout << v - p - ans << endl;

	return	0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   63 |                 scanf_s("%d,%d,%d,%d", &a, &b, &c, &d);
      |                 ^~~~~~~
      |                 scanf
a.cc:68:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   68 |         scanf_s("%d,%d,%d,%d",&s,&g,&v,&p);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;


struct edge {
	int cost;
	int to;
};

ll INF = 1000000000;
int N,M,s,g,v,p;
ll d[110];
vector<edge> G[110];

void dijkstra(int s) {
	priority_queue<pl, vector<pl>, greater<pl> > q;
	fill(d, d + N, INF);
	d[s] = 0;
	q.push(pl(0, s));

	while (!q.empty()) {
		pl p = q.top(); q.pop();
		int v = p.second;
		if (d[v] < p.first)continue;
		for (int i = 0; i < G[v].size(); i++) {
			edge e = G[v][i];
			if (d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				q.push(pl(d[e.to], e.to));
			}
		}
	}
}

int main()
{
	ll ans = 0;
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		int a, b, c, d;
		scanf_s("%d,%d,%d,%d", &a, &b, &c, &d);
		a--, b--;
		G[a].push_back({c,b});
		G[b].push_back({d,a});
	}
	scanf_s("%d,%d,%d,%d",&s,&g,&v,&p);
	s--, g--;
	dijkstra(s);
	ans += d[g];
	dijkstra(g);
	ans += d[s];
	cout << v - p - ans << endl;

	return	0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   62 |                 scanf_s("%d,%d,%d,%d", &a, &b, &c, &d);
      |                 ^~~~~~~
      |                 scanf
a.cc:67:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   67 |         scanf_s("%d,%d,%d,%d",&s,&g,&v,&p);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<iostream>

using namespace std;

#define REP(i, n) for(int i=0; i<n; i++)
#define REP1(i, n) for(int i=0; i<n; i++)

int INF = 10e8;
int n, m;
int dis[21][21];
int s, g, v, p;

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

    REP(i, n+1){
        REP(j, n+1){
            if(i!=0 && i==j){
                dis[i][j] = 0;
            } else {
                dis[i][j] = INF; dis[j][i] = INF;
            }
        }
    }

    REP(i, m){
        int a, b, c, d;
        scanf_s("%d,%d,%d,%d", &a, &b, &c, &d);
        dis[a][b] = c;
        dis[b][a] = d;
    }

    scanf_s("%d,%d,%d,%d", &s, &g, &v, &p);

    REP1(k, n+1){
        REP1(i, n+1){
            REP1(j, n+1){
                dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
            }
        }
    }

    int output = v - (p + dis[s][g] + dis[g][s]);
    cout << output << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   28 |         scanf_s("%d,%d,%d,%d", &a, &b, &c, &d);
      |         ^~~~~~~
      |         scanf
a.cc:33:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   33 |     scanf_s("%d,%d,%d,%d", &s, &g, &v, &p);
      |     ^~~~~~~
      |     scanf
Language: C++

#include<iostream>
#include<cstdio>

using namespace std;

#define REP(i, n) for(int i=0; i<n; i++)
#define REP1(i, n) for(int i=0; i<n; i++)

int INF = 10e8;
int n, m;
int dis[21][21];
int s, g, v, p;

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

    REP(i, n+1){
        REP(j, n+1){
            if(i!=0 && i==j){
                dis[i][j] = 0;
            } else {
                dis[i][j] = INF; dis[j][i] = INF;
            }
        }
    }

    REP(i, m){
        int a, b, c, d;
        scanf_s("%d,%d,%d,%d", &a, &b, &c, &d);
        dis[a][b] = c;
        dis[b][a] = d;
    }

    scanf_s("%d,%d,%d,%d", &s, &g, &v, &p);

    REP1(k, n+1){
        REP1(i, n+1){
            REP1(j, n+1){
                dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
            }
        }
    }

    int output = v - (p + dis[s][g] + dis[g][s]);
    cout << output << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   29 |         scanf_s("%d,%d,%d,%d", &a, &b, &c, &d);
      |         ^~~~~~~
      |         scanf
a.cc:34:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   34 |     scanf_s("%d,%d,%d,%d", &s, &g, &v, &p);
      |     ^~~~~~~
      |     scanf
Language: C++

#include<bits/stdc++.h>
#define SIZE 100005
#define MAX_V 100001
#define INF (1e9 + 1)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int g[20][20];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			g[i][j]=INF;
		}
	}
	for(int i=0;i<m;i++){
		int a,b,c,d;
		scanf("%d%d%d%d",&a,&b,&c,&d);
		g[a-1][b-1]=c;
		g[b-1][a-1]=d;
	}
	int s,g,V,P;
	scanf("%d%d%d%d",&s,&g,&V,&P);
	for(int k=0;k<n;k++)
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)
				g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
	printf("%d\n",V-P-g[s][g]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:34: error: invalid types 'int[int]' for array subscript
   29 |                                 g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
      |                                  ^
a.cc:29:46: error: invalid types 'int[int]' for array subscript
   29 |                                 g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
      |                                              ^
a.cc:29:54: error: invalid types 'int[int]' for array subscript
   29 |                                 g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
      |                                                      ^
a.cc:29:62: error: invalid types 'int[int]' for array subscript
   29 |                                 g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
      |                                                              ^
a.cc:30:28: error: invalid types 'int[int]' for array subscript
   30 |         printf("%d\n",V-P-g[s][g]);
      |                            ^
Language: C++

#include <stdio.h>
#include <math.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
using namespace std;






int main(){
    int n,m;
    int a[20][20];
    cin>>n>>m;
    fill(&a[0][0],&a[20][20],INT_MAX/2);
    for(int i=0;i<m;i++){
        int b,c,d,e;
        cin>>b>>c>>d>>e;
        a[b][c]=d;
        a[c][b]=e;
    }
    int s,g,gold,p;
    cin>>s>>g>>gold>>p;
    for(int k=0;k<n;k++){
        for(int i=0;i<n;i++){
            for(int t=0;t<n;t++){
                if(a[i][t]>a[i][k]+a[k][t]){a[i][t]=a[i][k]+a[k][t];}
            }
        }
    }
    cout<<gold-p-a[s][g];
    
    
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: 'INT_MAX' was not declared in this scope
   24 |     fill(&a[0][0],&a[20][20],INT_MAX/2);
      |                              ^~~~~~~
a.cc:13:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include<numeric>
  +++ |+#include <climits>
   13 | using namespace std;