Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>
#include <stack>
 
using namespace std;

typedef pair<int,int> P;
typedef pair<int,P> PP;

int n,m,l;
vector<vector<PP> > edge;


int solve()
{
	
	//??????i??§?????????j????????????????????°
	vector<vector<long> > memo(n,vector<long>(l+1,1000000));
	
	for(int i=0;i<=l;i++) memo[0][i]=0;
	
	priority_queue<PP,vector<PP>,greater<PP> > q;
	
	//?????¨??°0,??????0,?????????l
	q.push(PP(0,P(0,l)));
	
	while(!q.empty()){
		PP tmp=q.top(); q.pop();
		
		int now_v=tmp.first;
		int now_e=tmp.second.first;
		int now_l=tmp.second.second;
								
		for(int i=0;i<edge[now_v].size();i++){
			int to=edge[now_v][i].first;
			int e_num=edge[now_v][i].second.second;
			int cost=edge[now_v][i].second.first;

			//???????????????
			if(now_l>=cost){
				if(memo[to][now_l-cost]>memo[now_v][now_l]){
					memo[to][now_l-cost]=memo[now_v][now_l];
					q.push(PP(to,P(now_e,now_l-cost)));
				}
			}
			
			//?????????????????????
			if(memo[to][now_l]>memo[now_v][now_l]+e_num){
				memo[to][now_l]=memo[now_v][now_l]+e_num;
				q.push(PP(to,P(now_e+e_num,now_l)));
			}			
		}
		
	}
	
	int ans=memo[n-1][0];
	for(int i=1;i<=l;i++) ans=min(ans,memo[n-1][i]);
	
	return ans;
	
}

int main()
{
	
	while(cin>>n>>m>>l,n){		
			
		edge.clear();
		edge.resize(n);
		
		for(int i=0;i<m;i++){
			int a,b,d,e;
			cin>>a>>b>>d>>e;
			a--; b--;
			
			edge[a].push_back(PP(b,P(d,e)));
			edge[b].push_back(PP(a,P(d,e)));
			
		}
		cout<<solve()<<endl;
		
	}
		
	

	return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:68:38: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type&)'
   68 |         for(int i=1;i<=l;i++) ans=min(ans,memo[n-1][i]);
      |                                   ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:68:38: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type' {aka 'long int'})
   68 |         for(int i=1;i<=l;i++) ans=min(ans,memo[n-1][i]);
      |                                   ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:68:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   68 |         for(int i=1;i<=l;i++) ans=min(ans,memo[n-1][i]);
      |                                   ~~~^~~~~~~~~~~~~~~~~~