Language: C++

typedef long long int lld;
typedef pair<lld,int> Pd;
typedef pair<lld,lld> P;
#define INF ((lld)1<<50)

lld n,m,C;
vector<P> node[200010];
lld min_cost[100010];
vector<P> X;
lld sum = 0;

int main(){
  cin >> n >> m >> C;
  for(int i=0;i<m;i++){
    lld a,b,c; cin >> a >> b >> c;
    a--; b--; sum += c;
    node[a].push_back(P(b,c));
    node[b].push_back(P(a,c));
  }
  fill_n(min_cost,100010,INF);
  priority_queue<P,vector<P>,greater<P> > que;
  min_cost[0] = 0;
  que.push(P(0,0));
  while(!que.empty()){
    P p = que.top(); que.pop();
    lld cnt = p.first;
    lld pos = p.second;
    if(min_cost[pos] < cnt) continue;
    for(int i=0;i<node[pos].size();i++){
      P pi = node[pos][i];
      lld next = pi.first, cost = pi.second;
      if(min_cost[next] > cost + cnt){
        min_cost[next] = cost + cnt;
        que.push(P(cost+cnt,next));
      }
    }
  }
  for(int i=0;i<n;i++){
    X.push_back(P(min_cost[i],i));
  }
  for(int i=0;i<n;i++){
    cout << X[i].first << " " << X[i].second << endl;
  }
  sort(X.begin(),X.end());
  for(int i=0;i<n;i++){
    cout << X[i].first << " " << X[i].second << endl;
  }
  X.push_back(P(INF,0));
  lld ret = INF;
  bool used[100010];
  memset(used,0,sizeof(used));
  for(int i=0;i<n;i++){
    int pos = X[i].second;
    used[pos] = true;
    for(int j=0;j<node[pos].size();j++){
      if(used[node[pos][j].first]) sum -= node[pos][j].second;
    }
    if(i != n-1 && X[i].first == X[i+1].first) continue;
    ret = min(ret,sum+C*X[i].first);
  }
  cout << ret << endl;
}

Compiler output:
a.cc:2:9: error: 'pair' does not name a type
    2 | typedef pair<lld,int> Pd;
      |         ^~~~
a.cc:3:9: error: 'pair' does not name a type
    3 | typedef pair<lld,lld> P;
      |         ^~~~
a.cc:7:1: error: 'vector' does not name a type
    7 | vector<P> node[200010];
      | ^~~~~~
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<P> X;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:13:3: error: 'cin' was not declared in this scope
   13 |   cin >> n >> m >> C;
      |   ^~~
a.cc:17:5: error: 'node' was not declared in this scope
   17 |     node[a].push_back(P(b,c));
      |     ^~~~
a.cc:17:23: error: 'P' was not declared in this scope
   17 |     node[a].push_back(P(b,c));
      |                       ^
a.cc:20:3: error: 'fill_n' was not declared in this scope
   20 |   fill_n(min_cost,100010,INF);
      |   ^~~~~~
a.cc:21:3: error: 'priority_queue' was not declared in this scope
   21 |   priority_queue<P,vector<P>,greater<P> > que;
      |   ^~~~~~~~~~~~~~
a.cc:21:18: error: 'P' was not declared in this scope
   21 |   priority_queue<P,vector<P>,greater<P> > que;
      |                  ^
a.cc:21:20: error: 'vector' was not declared in this scope
   21 |   priority_queue<P,vector<P>,greater<P> > que;
      |                    ^~~~~~
a.cc:21:29: error: expected primary-expression before ',' token
   21 |   priority_queue<P,vector<P>,greater<P> > que;
      |                             ^
a.cc:21:30: error: 'greater' was not declared in this scope
   21 |   priority_queue<P,vector<P>,greater<P> > que;
      |                              ^~~~~~~
a.cc:21:41: error: expected primary-expression before '>' token
   21 |   priority_queue<P,vector<P>,greater<P> > que;
      |                                         ^
a.cc:21:43: error: 'que' was not declared in this scope
   21 |   priority_queue<P,vector<P>,greater<P> > que;
      |                                           ^~~
a.cc:25:6: error: expected ';' before 'p'
   25 |     P p = que.top(); que.pop();
      |      ^~
      |      ;
a.cc:26:15: error: 'p' was not declared in this scope
   26 |     lld cnt = p.first;
      |               ^
a.cc:29:19: error: 'node' was not declared in this scope
   29 |     for(int i=0;i<node[pos].size();i++){
      |                   ^~~~
a.cc:30:8: error: expected ';' before 'pi'
   30 |       P pi = node[pos][i];
      |        ^~~
      |        ;
a.cc:31:18: error: 'pi' was not declared in this scope; did you mean 'i'?
   31 |       lld next = pi.first, cost = pi.second;
      |                  ^~
      |                  i
a.cc:32:27: error: 'cost' was not declared in this scope; did you mean 'const'?
   32 |       if(min_cost[next] > cost + cnt){
      |                           ^~~~
      |                           const
a.cc:39:5: error: 'X' was not declared in this scope
   39 |     X.push_back(P(min_cost[i],i));
      |     ^
a.cc:42:5: error: 'cout' was not declared in this scope
   42 |     cout << X[i].first << " " << X[i].second << endl;
      |     ^~~~
a.cc:42:13: error: 'X' was not declared in this scope
   42 |     cout << X[i].first << " " << X[i].second << endl;
      |             ^
a.cc:42:49: error: 'endl' was not declared in this scope
   42 |     cout << X[i].first << " " << X[i].second << endl;
      |                                                 ^~~~
a.cc:44:8: error: 'X' was not declared in this scope
   44 |   sort(X.begin(),X.end());
      |        ^
a.cc:44:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   44 |   sort(X.begin(),X.end());
      |   ^~~~
      |   short
a.cc:46:5: error: 'cout' was not declared in this scope
   46 |     cout << X[i].first << " " << X[i].second << endl;
      |     ^~~~
a.cc:46:49: error: 'endl' was not declared in this scope
   46 |     cout << X[i].first << " " << X[i].second << endl;
      |                                                 ^~~~
a.cc:51:3: error: 'memset' was not declared in this scope
   51 |   memset(used,0,sizeof(used));
      |   ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | typedef long long int lld;
a.cc:55:19: error: 'node' was not declared in this scope
   55 |     for(int j=0;j<node[pos].size();j++){
      |                   ^~~~
a.cc:59:11: error: 'min' was not declared in this scope; did you mean 'main'?
   59 |     ret = min(ret,sum+C*X[i].first);
      |           ^~~
      |           main
a.cc:61:3: error: 'cout' was not declared in this scope
   61 |   cout << ret << endl;
      |   ^~~~
a.cc:61:18: error: 'endl' was not declared in this scope
   61 |   cout << ret << endl;
      |                  ^~~~