Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<functional>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)
#define INF INT_MAX/2

struct St {
	int node;
	int money;
	int attack;
	St(int _node, int _money, int _attack) {
		node = _node;
		money = _money;
		attack = _attack;
	}

	bool operator >(const St &e) const {
		return attack > e.attack;
	}
};


int dp[101][101]; // i?????????????±???§??????????????????j????????????????\???????????????°???????°????
int main()
{
	int N, M, L;
	while (cin >> N >> M >> L, N || M || L) {
		pair<int, int> p[101][101];
		REP(i, 0, N) {
			REP(j, 0, N) {
				p[i][j].first = p[i][j].second = INF;
			}
		}
		REP(i, 0, M) {
			int A, B, D, E;
			cin >> A >> B >> D >> E;
			p[A - 1][B - 1].first = p[B - 1][A - 1].first = D;
			p[A - 1][B - 1].second = p[B - 1][A - 1].second = E;
		}

		REP(i, 0, N) {
			REP(j, 0, L + 1) {
				dp[i][j] = INF;
			}
		}
		dp[0][L] = 0;

		priority_queue<St, vector<St>, greater<St>> pq;
		St st(0, L, 0);
		pq.push(st);
		while (!pq.empty()) {
			St now = pq.top();
			pq.pop();

			int nowN = now.node;
			int nowM = now.money;
			int nowA = now.attack;

			if (dp[nowN][nowM] < nowA) continue;
			REP(i, 0, N) {
				if (p[nowN][i].first == INF) continue;

				/* ??????????????? */
				if (p[nowN][i].first <= nowM) {
					int nextM = nowM - p[nowN][i].first;
					int nextA = nowA;

					if (nextA < dp[i][nextM]) {
						dp[i][nextM] = nextA;
						St nextS(i, nextM, nextA);
						pq.push(nextS);
					}
				}


				/* ????????????????????? */
				int nextM = nowM;
				int nextA = nowA + p[nowN][i].second;

				if (nextA < dp[i][nextM]) {
					dp[i][nextM] = nextA;
					St nextS(i, nextM, nextA);
					pq.push(nextS);
				}
			}
		}

		int ans = INF;
		REP(i, 0, L + 1) {
			ans = min(ans, dp[N - 1][i]);
		}
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'INT_MAX' was not declared in this scope
    9 | #define INF INT_MAX/2
      |             ^~~~~~~
a.cc:35:66: note: in expansion of macro 'INF'
   35 |                                 p[i][j].first = p[i][j].second = INF;
      |                                                                  ^~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include<functional>
  +++ |+#include <climits>
    7 | using namespace std;
a.cc:9:13: error: 'INT_MAX' was not declared in this scope
    9 | #define INF INT_MAX/2
      |             ^~~~~~~
a.cc:47:44: note: in expansion of macro 'INF'
   47 |                                 dp[i][j] = INF;
      |                                            ^~~
a.cc:9:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #define INF INT_MAX/2
      |             ^~~~~~~
a.cc:47:44: note: in expansion of macro 'INF'
   47 |                                 dp[i][j] = INF;
      |                                            ^~~
a.cc:9:13: error: 'INT_MAX' was not declared in this scope
    9 | #define INF INT_MAX/2
      |             ^~~~~~~
a.cc:65:57: note: in expansion of macro 'INF'
   65 |                                 if (p[nowN][i].first == INF) continue;
      |                                                         ^~~
a.cc:9:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #define INF INT_MAX/2
      |             ^~~~~~~
a.cc:65:57: note: in expansion of macro 'INF'
   65 |                                 if (p[nowN][i].first == INF) continue;
      |                                                         ^~~
a.cc:9:13: error: 'INT_MAX' was not declared in this scope
    9 | #define INF INT_MAX/2
      |             ^~~~~~~
a.cc:92:27: note: in expansion of macro 'INF'
   92 |                 int ans = INF;
      |                           ^~~
a.cc:9:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #define INF INT_MAX/2
      |             ^~~~~~~
a.cc:92:27: note: in expansion of macro 'INF'
   92 |                 int ans = INF;
      |                           ^~~