Language: C++

include<bits/stdc++.h>
#define F first
#define S second
#define INF 1<<28
using namespace std;
 
int c, n, s, d;
typedef pair < int, int > P;
typedef pair < int, P > PP;
vector < P > vec[111];
 
int solve(){
 
  int dist[111][11]; for(int i=0;i<111;i++)for(int j=0;j<11;j++) dist[i][j] = INF;
  priority_queue < PP, vector<PP>, greater<PP> > que;
 
  dist[s][c] = 0;
  que.push( PP(0, P(s, c)) ); //Now_cost, Now_node, Now_ticket
 
  while(!que.empty()){
    PP p = que.top(); que.pop();
    int cost = p.F, now = p.S.F, tic = p.S.S;
 
    //if(dist[now][tic] < cost) continue;
    for(int i=0;i<vec[now].size();i++){
      P to = vec[now][i];
      if(dist[to.S][tic] > dist[now][tic] + to.F){
	dist[to.S][tic] = dist[now][tic] + to.F;
	que.push( PP(dist[to.S][tic], P(to.S, tic)) );
      }
      if(tic && dist[to.S][tic-1] > dist[now][tic] + to.F/2){
	dist[to.S][tic-1] = dist[now][tic] + to.F/2;
	que.push( PP(dist[to.S][tic-1], P(to.S, tic-1)) );
      }
    }
  }
   
  int ans = INF;
  for(int i=0;i<=c;i++){ ans = min(ans, dist[d][i]); } //cout << ans << endl; }
  return dist[d][0];
}
 
int main(){
 
  int m, a, b, p;
 
   
  while(cin >> c >> n >> m >> s >> d){
    if((c|n|m|s|d) == 0) break;
    for(int i=0;i<111;i++) vec[i].clear();
    for(;m--;){
      cin >> a >> b >> p;
      vec[a].push_back(P(p, b)); //[now] P(cost, next);
      vec[b].push_back(P(p, a));
    }
     
    cout << solve() << endl;
  }
   
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc:8:9: error: 'pair' does not name a type
    8 | typedef pair < int, int > P;
      |         ^~~~
a.cc:9:9: error: 'pair' does not name a type
    9 | typedef pair < int, P > PP;
      |         ^~~~
a.cc:10:1: error: 'vector' does not name a type
   10 | vector < P > vec[111];
      | ^~~~~~
a.cc: In function 'int solve()':
a.cc:15:3: error: 'priority_queue' was not declared in this scope
   15 |   priority_queue < PP, vector<PP>, greater<PP> > que;
      |   ^~~~~~~~~~~~~~
a.cc:15:20: error: 'PP' was not declared in this scope
   15 |   priority_queue < PP, vector<PP>, greater<PP> > que;
      |                    ^~
a.cc:15:24: error: 'vector' was not declared in this scope
   15 |   priority_queue < PP, vector<PP>, greater<PP> > que;
      |                        ^~~~~~
a.cc:15:34: error: expected primary-expression before ',' token
   15 |   priority_queue < PP, vector<PP>, greater<PP> > que;
      |                                  ^
a.cc:15:36: error: 'greater' was not declared in this scope
   15 |   priority_queue < PP, vector<PP>, greater<PP> > que;
      |                                    ^~~~~~~
a.cc:15:48: error: expected primary-expression before '>' token
   15 |   priority_queue < PP, vector<PP>, greater<PP> > que;
      |                                                ^
a.cc:15:50: error: 'que' was not declared in this scope
   15 |   priority_queue < PP, vector<PP>, greater<PP> > que;
      |                                                  ^~~
a.cc:18:19: error: 'P' was not declared in this scope
   18 |   que.push( PP(0, P(s, c)) ); //Now_cost, Now_node, Now_ticket
      |                   ^
a.cc:21:7: error: expected ';' before 'p'
   21 |     PP p = que.top(); que.pop();
      |       ^~
      |       ;
a.cc:22:16: error: 'p' was not declared in this scope
   22 |     int cost = p.F, now = p.S.F, tic = p.S.S;
      |                ^
a.cc:25:19: error: 'vec' was not declared in this scope
   25 |     for(int i=0;i<vec[now].size();i++){
      |                   ^~~
a.cc:25:23: error: 'now' was not declared in this scope
   25 |     for(int i=0;i<vec[now].size();i++){
      |                       ^~~
a.cc:26:8: error: expected ';' before 'to'
   26 |       P to = vec[now][i];
      |        ^~~
      |        ;
a.cc:27:15: error: 'to' was not declared in this scope
   27 |       if(dist[to.S][tic] > dist[now][tic] + to.F){
      |               ^~
a.cc:27:21: error: 'tic' was not declared in this scope
   27 |       if(dist[to.S][tic] > dist[now][tic] + to.F){
      |                     ^~~
a.cc:31:10: error: 'tic' was not declared in this scope
   31 |       if(tic && dist[to.S][tic-1] > dist[now][tic] + to.F/2){
      |          ^~~
a.cc:31:22: error: 'to' was not declared in this scope
   31 |       if(tic && dist[to.S][tic-1] > dist[now][tic] + to.F/2){
      |                      ^~
a.cc:39:32: error: 'min' was not declared in this scope
   39 |   for(int i=0;i<=c;i++){ ans = min(ans, dist[d][i]); } //cout << ans << endl; }
      |                                ^~~
a.cc: In function 'int main()':
a.cc:48:9: error: 'cin' was not declared in this scope
   48 |   while(cin >> c >> n >> m >> s >> d){
      |         ^~~
a.cc:50:28: error: 'vec' was not declared in this scope
   50 |     for(int i=0;i<111;i++) vec[i].clear();
      |                            ^~~
a.cc:53:7: error: 'vec' was not declared in this scope
   53 |       vec[a].push_back(P(p, b)); //[now] P(cost, next);
      |       ^~~
a.cc:53:24: error: 'P' was not declared in this scope
   53 |       vec[a].push_back(P(p, b)); //[now] P(cost, next);
      |                        ^
a.cc:57:5: error: 'cout' was not declared in this scope
   57 |     cout << solve() << endl;
      |     ^~~~
a.cc:57:24: error: 'endl' was not declared in this scope
   57 |     cout << solve() << endl;
      |                        ^~~~