Language: C++

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

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

typedef long long ll;
typedef pair<int, int> p;

struct Graph {
  vector<vector<ll>> yen;
  vector<vector<ll>> snuke;
  vector<bool> visited1;
  vector<bool> visited2;
  vector<ll> min_cost1;
  vector<ll> min_cost2;
  ll node_num, edge_num;

  Graph(ll nn, ll en) : node_num(nn), edge_num(en){
    visited1 = vector<bool> (node_num, false);
    visited2 = vector<bool> (node_num, false);
    min_cost1 = vector<ll> (node_num, INT_MAX);
    min_cost2 = vector<ll> (node_num, INT_MAX);
    yen = vector<vector<ll>> (node_num, vector<ll> (node_num, -1));
    snuke = vector<vector<ll>> (node_num, vector<ll> (node_num, -1));
  }

  ll dijkstra1(ll start){
    min_cost1[start] = 0;
    ll now = start;
    while(true) {
      if(now == -1) return -1;
      visited1[now] = true;
      for (ll i = 0; i < ll(yen.size()); i++) {
        if(yen[now][i] != -1){
          min_cost1[i] = min(min_cost1[i], min_cost1[now]+yen[now][i]);
        }
      }

      ll min_node_index = -1;
      ll min_node_cost = INT_MAX;
      for (ll i = 0; i < ll(yen.size()); i++) {
        if((min_node_cost > min_cost1[i]) && !visited1[i]){
          min_node_index = i;
          min_node_cost = min_cost1[i];
        }
      }
      now = min_node_index;
    }

    // error
    return -1;
  }

  ll dijkstra2(ll start){
    min_cost2[start] = 0;
    ll now = start;
    while(true) {
      if(now == -1) return -1;
      visited2[now] = true;
      for (ll i = 0; i < ll(snuke.size()); i++) {
        if(snuke[now][i] != -1){
          min_cost2[i] = min(min_cost2[i], min_cost2[now]+snuke[now][i]);
        }
      }

      ll min_node_index = -1;
      ll min_node_cost = INT_MAX;
      for (ll i = 0; i < ll(snuke.size()); i++) {
        if((min_node_cost > min_cost2[i]) && !visited2[i]){
          min_node_index = i;
          min_node_cost = min_cost2[i];
        }
      }
      now = min_node_index;
    }

    // error
    return -1;
  }

  void init(){
    visited1 = vector<bool> (node_num, false);
    min_cost1 = vector<ll> (node_num, INT_MAX);
  }
};

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, m, s, t;
  cin >> n >> m >> s >> t;
  s--;t--;
  Graph g(n, m);
  for (ll i = 0; i < m; i++) {
    ll from, to, yen, snuke;
    cin >> from >> to >> yen >> snuke;
    from--; to--;
    g.yen[from][to] = yen;
    g.yen[to][from] = yen;
    g.snuke[from][to] = snuke;
    g.snuke[to][from] = snuke;
  }

  g.dijkstra1(s);
  print(g.min_cost1);
  g.dijkstra2(t);
  print(g.min_cost2);

  print(g.yen);
  print(g.snuke);
  vector<ll> res(n, LLONG_MAX);
  ll now = LLONG_MAX;
  ll money = pow(10, 15);

  for (int i = n-1; i >= 0; i--) {
    now = min(now, g.min_cost1[i]+g.min_cost2[i]);
    res[i] = money - now;
  }

  for (int i = 0; i < n; i++) {
    cout << res[i] << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:111:3: error: 'print' was not declared in this scope; did you mean 'rint'?
  111 |   print(g.min_cost1);
      |   ^~~~~
      |   rint