Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,s,t;
  cin>>n>>m>>s>>t;
  long long int u[m],v[m],a[m],b[m];
  int gy[n][n],gs[n][n];
  for(int x=0;x<n;x++)for(int y=0;y<n;y++){
    gy[x][y]=10000000000+1;
    gs[x][y]=10000000000+1;
  }

  for(int i=0;i<m;i++){
    cin>>u[i]>>v[i]>>a[i]>>b[i];
    gy[u[i]-1][v[i]-1]=a[i];
    gy[v[i]-1][u[i]-1]=gy[u[i]-1][v[i]-1];
    gs[u[i]-1][v[i]-1]=b[i];
    gs[v[i]-1][u[i]-1]=gs[u[i]-1][v[i]-1];
  }

  bool f=true;
  while (f){
    f=false;
    for(int x=0;x<n;x++)for(int y=0;y<n;y++){
      if(x==y){
        gy[x][y]=0;
        gy[y][x]=0;
        gs[x][y]=0;
        gs[y][x]=0;
        continue;
      }
      for(int i=0;i<n;i++){
        if(i==x or i==y) continue;
//        cout<<x<<","<<y<<","<<i<<endl;
        if (gy[x][y]==gy[x][i]+gy[i][y] or gs[x][y]==gs[x][i]+gs[i][y]) continue;
        gy[x][y]=min(gy[x][y],gy[x][i]+gy[i][y]);
        gy[y][x]=gy[x][y];
        gs[x][y]=min(gs[x][y],gs[x][i]+gs[i][y]);
        gs[y][x]=gs[x][y];
        if(gy[x][y]==gy[x][i]+gy[i][y] or gs[x][y]==gs[x][i]+gs[i][y])f=true;

      }
    }
  }
  for(int i=0;i<n;i++){
    long long int low=100000000001;
    for(int j=0;j<n;j++){
      if (j<i)continue;
      low=min(low,gy[s-1][j]+gs[j][t-1]);
    //  cout<<low<<","<<j<<endl;
    }
    cout<<1000000000000000-low<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000001' to '1410065409' [-Woverflow]
    9 |     gy[x][y]=10000000000+1;
      |              ~~~~~~~~~~~^~
a.cc:10:25: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000001' to '1410065409' [-Woverflow]
   10 |     gs[x][y]=10000000000+1;
      |              ~~~~~~~~~~~^~
a.cc:49:14: error: no matching function for call to 'min(long long int&, int)'
   49 |       low=min(low,gy[s-1][j]+gs[j][t-1]);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:49:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   49 |       low=min(low,gy[s-1][j]+gs[j][t-1]);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:49:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   49 |       low=min(low,gy[s-1][j]+gs[j][t-1]);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~