Language: C++

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

#define M_MAX 1000000000000000;

int main() {

  while( true ) {

    long long int n, m, c, s, g;
    cin >> n >> m >> c >> s >> g;
    if ( n == 0 ) break;

    long long int d[101][101][21] = {};

    for ( long long int i = 0; i <= n; i++ ) {
      for ( long long int j = 0; j <= n; j++ ) {
	for ( long long int k = 0; k <= c; k++ ) {
	  d[i][j][k] = M_MAX;
	}
      }
    }
    
    for ( long long int i = 0; i < m; i++ ) {

      long long int x, y, in_d, in_c;
      cin >> x >> y >> in_d >> in_c;
      d[x][y][in_c] = in_d;
      d[y][x][in_c] = in_d;
      
    }

    vector< long long int > pp;
    for ( long long int i = 0; i < c; i++ ) {
      long long int in;
      cin >> in;
      pp.push_back( in );
    }

    vector< vector< long long int > > q, r;
    for ( long long int i = 0; i < c; i++ ) {
      vector< long long int > vq, vr;
      vq.push_back( 0 );
      for ( long long int j = 0; j < pp[i] - 1; j++ ) {
	long long int in;
	cin >> in;
	vq.push_back( in );
      }
      vq.push_back( M_MAX );
      for ( long long int j = 0; j < pp[i]; j++ ) {
	long long int in;
	cin >> in;
	vr.push_back( in );
      }
      q.push_back( vq );
      r.push_back( vr );
    }

    for ( long long int p = 1; p <= c; p++ ) {
      for ( long long int k = 1; k <= n; k++ ) {
	for ( long long int i = 1; i <= n; i++ ) {
	  for ( long long int j = 1; j <= n; j++ ) {
	    d[i][j][p] = min( d[i][j][p], d[i][k][p] + d[k][j][p] );
	  }
	}
      }
    }
    
    long long int mo[101][101][21] = {};
    for ( long long int p = 1; p <= c; p++ ) {
      for ( long long int i = 1; i <= n; i++ ) {
	for ( long long int j = 1; j <= n; j++ ) {
	  long long int k = 0;
	  for ( long long int u = 1; true; u++ ) {
	    if ( d[i][j][p] >= M_MAX ) {
	      k = M_MAX;
	      break;
	    }
	    if ( d[i][j][p] <= q[p-1][u] ) {
	      k += ( d[i][j][p] - q[p-1][u-1] ) * r[p-1][u-1];
	      break;
	    }else {
	      k += ( q[p-1][u] - q[p-1][u-1] ) * r[p-1][u-1];
	    }
	  }
	  mo[i][j][p] = k;
	}
      }
    }

    
    for ( long long int i = 0; i <= n; i++ ) {
      for ( long long int j = 0; j <= n; j++ ) {
	mo[i][j][0] = M_MAX;
	for ( long long int k = 1; k <= c; k++ ) {
	  mo[i][j][0] = min( mo[i][j][0], mo[i][j][k] );
	}
      }
    }

    for ( long long int k = 1; k <= n; k++ ) {
      for ( long long int i = 1; i <= n; i++ ) {
	for ( long long int j = 1; j <= n; j++ ) {
	  mo[i][j][0] = min( mo[i][j][0], mo[i][k][0] + mo[k][j][0] );
	}
      }
    }

    if ( mo[s][g][0] >= M_MAX ) {
      cout << -1 << endl;
    }else {
      cout << mo[s][g][0] << endl;
    }

  }
  
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:31: error: expected ')' before ';' token
    5 | #define M_MAX 1000000000000000;
      |                               ^
a.cc:50:21: note: in expansion of macro 'M_MAX'
   50 |       vq.push_back( M_MAX );
      |                     ^~~~~
a.cc:50:19: note: to match this '('
   50 |       vq.push_back( M_MAX );
      |                   ^
a.cc:50:27: error: expected primary-expression before ')' token
   50 |       vq.push_back( M_MAX );
      |                           ^
a.cc:76:38: error: expected primary-expression before ')' token
   76 |             if ( d[i][j][p] >= M_MAX ) {
      |                                      ^
a.cc:110:31: error: expected primary-expression before ')' token
  110 |     if ( mo[s][g][0] >= M_MAX ) {
      |                               ^