Language: C++

typedef pair<int, int> pi; // ?????????????????? ?????¨??????
typedef pair<int, pi> P; // ????????? pi

struct edge{ int to, cost; };

int C, V, E, S, D;
int d[128][16];
vector<vector<edge> >G(128);

void dijkstra(int s){
  priority_queue<P, vector<P>, greater<P> >q;
  rep(i, V) rep(j, C+1) d[i][j] = INF;
  d[s][C] = 0;
  q.push(MP(0, MP(C, s)));

  while(!q.empty()){
    P p = q.top(); q.pop();
    int v = p.S.S;
    int c = p.S.F;

    rep(i, G[v].size()){
      edge e = G[v][i];
      if(d[e.to][c] > d[v][c] + e.cost){
    d[e.to][c] = d[v][c] + e.cost;
    q.push(MP(d[e.to][c], MP(c, e.to)));
      }

      if( c > 0 && d[e.to][c-1] > d[v][c] + e.cost/2){
      d[e.to][c-1] = d[v][c] + e.cost/2;
      q.push(MP(d[e.to][c-1], MP(c-1, e.to)));
      }
    }
  }
}

int main(){
  while(scanf("%d%d%d%d%d", &C, &V, &E, &S, &D) && C+V+E+S+D){
    S--; D--;
    rep(i, 128){
      G[i].clear();
    }

    rep(i, E){
      int a, b, c;
      scanf("%d%d%d", &a, &b, &c); a--; b--;
     edge e;
      e.to = a; e.cost = c;
      G[b].PB(e);
      e.to = b;
      G[a].PB(e);
    }

    dijkstra(S);

    int res = INF;
    rep(i, C+1) res = min(res, d[D][i]);
    printf("%d\n", res);
  }
  return 0;
}

Compiler output:
a.cc:1:9: error: 'pair' does not name a type
    1 | typedef pair<int, int> pi; // ?????????????????? ?????¨??????
      |         ^~~~
a.cc:2:9: error: 'pair' does not name a type
    2 | typedef pair<int, pi> P; // ????????? pi
      |         ^~~~
a.cc:8:1: error: 'vector' does not name a type
    8 | vector<vector<edge> >G(128);
      | ^~~~~~
a.cc: In function 'void dijkstra(int)':
a.cc:11:3: error: 'priority_queue' was not declared in this scope
   11 |   priority_queue<P, vector<P>, greater<P> >q;
      |   ^~~~~~~~~~~~~~
a.cc:11:18: error: 'P' was not declared in this scope
   11 |   priority_queue<P, vector<P>, greater<P> >q;
      |                  ^
a.cc:11:21: error: 'vector' was not declared in this scope
   11 |   priority_queue<P, vector<P>, greater<P> >q;
      |                     ^~~~~~
a.cc:11:30: error: expected primary-expression before ',' token
   11 |   priority_queue<P, vector<P>, greater<P> >q;
      |                              ^
a.cc:11:32: error: 'greater' was not declared in this scope
   11 |   priority_queue<P, vector<P>, greater<P> >q;
      |                                ^~~~~~~
a.cc:11:43: error: expected primary-expression before '>' token
   11 |   priority_queue<P, vector<P>, greater<P> >q;
      |                                           ^
a.cc:11:44: error: 'q' was not declared in this scope
   11 |   priority_queue<P, vector<P>, greater<P> >q;
      |                                            ^
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   rep(i, V) rep(j, C+1) d[i][j] = INF;
      |       ^
a.cc:12:3: error: 'rep' was not declared in this scope
   12 |   rep(i, V) rep(j, C+1) d[i][j] = INF;
      |   ^~~
a.cc:14:16: error: 'MP' was not declared in this scope
   14 |   q.push(MP(0, MP(C, s)));
      |                ^~
a.cc:14:10: error: 'MP' was not declared in this scope
   14 |   q.push(MP(0, MP(C, s)));
      |          ^~
a.cc:17:6: error: expected ';' before 'p'
   17 |     P p = q.top(); q.pop();
      |      ^~
      |      ;
a.cc:18:13: error: 'p' was not declared in this scope
   18 |     int v = p.S.S;
      |             ^
a.cc:21:12: error: 'G' was not declared in this scope
   21 |     rep(i, G[v].size()){
      |            ^
a.cc: In function 'int main()':
a.cc:37:9: error: 'scanf' was not declared in this scope
   37 |   while(scanf("%d%d%d%d%d", &C, &V, &E, &S, &D) && C+V+E+S+D){
      |         ^~~~~
a.cc:39:9: error: 'i' was not declared in this scope
   39 |     rep(i, 128){
      |         ^
a.cc:39:5: error: 'rep' was not declared in this scope
   39 |     rep(i, 128){
      |     ^~~
a.cc:55:15: error: 'INF' was not declared in this scope
   55 |     int res = INF;
      |               ^~~
a.cc:57:5: error: 'printf' was not declared in this scope
   57 |     printf("%d\n", res);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | typedef pair<int, int> pi; // ?????????????????? ?????¨??????