Language: C++

#include<iostream>
#include<queue>
#include<map>
#define LEN 100
#define BASE 25

using namespace std;

int maps[LEN][LEN];
int off[LEN][LEN];

int checker[4];
int ncheck[4];

map<int, int> points[LEN];

class State {
public:
	char where;
	int enemy;
	int budget;
	int check[4];
	State() {check[0]=0;check[1]=0;check[2]=0;check[3]=0;}
	State(char w, int e, int b ) {
		where = w;
		enemy = e;
		budget = b; 
		check[0] = ncheck[0];
		check[1] = ncheck[1];
		check[2] = ncheck[2];
		check[3] = ncheck[3];
	}
};

bool operator< ( const State& a, const State& b) {
	if( a.enemy == b.enemy )
		return a.budget < b.budget;
	return a.enemy < b.enemy;
}

bool operator> ( const State& a, const State& b) {
	if ( a.enemy == b.enemy )
		return a.budget > b.budget;
	
	return a.enemy > b.enemy;
}

priority_queue<State, vector<State>, greater<State> > status;

inline void copy ( State now ) {
	checker[0] = now.check[0];
	checker[1] = now.check[1];
	checker[2] = now.check[2];
	checker[3] = now.check[3];
}

inline void ncopy ( ) {
	ncheck[0] = checker[0];
	ncheck[1] = checker[1];
	ncheck[2] = checker[2];
	ncheck[3] = checker[3];
}

inline bool check ( int i ) {
	return 0 == ((1<<(i%25)) & checker[i/BASE]);
}

inline void add ( int i ) {
	ncheck[i/BASE] = ((1<<(i%25)) | checker[i/BASE]);
}

inline void insert ( int i, int e, int b ) {
	
	map<int,int>::iterator itr = points[i].find(e);
	if ( itr == points[i].end() ) {
		points[i][e] = b;
		status.push(State(i,e,b));
	} else if ( (*itr).second < b ) {
		(*itr).second = b;
		status.push(State(i,e,b));
	}
}

int main () {


	while ( true ) {
		int n,m,l;
		cin >> n >> m >> l;

		if ( n == 0 )
			break;

		for ( int i=0; i<n; i++ ) {
			for ( int j=0; j<n; j++ ) {
				maps[i][j] = -1;
				off[i][j] = 0;
			}
			points[i].clear();
		}

		for ( int i=0; i<m; i++ ) {
			int a,b,d,e;
			cin >> a >> b >> d >> e;

			maps[a-1][b-1] = maps[b-1][a-1] = d;
			off[a-1][b-1] = off[b-1][a-1] = e;
		}

		for ( int i=0; i<4; i++ ) {
			ncheck[i] = 0;
			checker[i] = 0;
		}

		status = priority_queue();

		/*
		while( !status.empty() ) {
			status.pop() ;
		}	
		*/
		ncheck[0] = 1;
		status.push(State(0,0,l));
		int count = 0;
		while(!status.empty()) {
			State now = status.top();
			status.pop();
			if ( now.where == n-1 ) {
				cout << now.enemy << endl;
				break;
			}

			copy(now);

			for ( int i=0; i<n; i++ ) {
				if ( maps[now.where][i] > 0 ) {
					if ( check( i ) ) {
						ncopy();
						add(i);
						int e, b;
						if ( off[now.where][i] == 0 ) {
							e = now.enemy;
							b = now.budget;
							insert(i,e,b);
						} else {
							if ( now.budget - maps[now.where][i] >= 0 ) {
								e = now.enemy;
								b = now.budget - maps[now.where][i];
								insert(i,e,b);
							}
							e = now.enemy + off[now.where][i];
							b = now.budget;
							insert(i,e,b);
						}
					}
				}
			}
		}
	}
}

		

Compiler output:
a.cc: In function 'int main()':
a.cc:115:41: error: class template argument deduction failed:
  115 |                 status = priority_queue();
      |                                         ^
a.cc:115:41: error: no matching function for call to 'priority_queue()'
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_queue.h:691:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class _Alloc, class _Requires> priority_queue(_InputIterator, _InputIterator, const _Compare&, _Sequence&&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  691 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:691:9: note:   candidate expects 5 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:679:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class _Alloc, class, class _Requires> priority_queue(_InputIterator, _InputIterator, const _Compare&, const _Sequence&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  679 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:679:9: note:   candidate expects 5 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:671:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class _Alloc, class, class _Requires> priority_queue(_InputIterator, _InputIterator, const _Compare&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  671 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:671:9: note:   candidate expects 4 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:663:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class _Alloc, class, class _Requires> priority_queue(_InputIterator, _InputIterator, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  663 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:663:9: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:649:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class> priority_queue(_InputIterator, _InputIterator, const _Compare&, _Sequence&&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  649 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:649:9: note:   candidate expects 4 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:638:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class> priority_queue(_InputIterator, _InputIterator, const _Compare&, const _Sequence&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  638 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:638:9: note:   candidate expects 4 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:629:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class> priority_queue(_InputIterator, _InputIterator, const _Compare&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  629 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:629:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:594:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(std::priority_queue<_Tp, _Sequence, _Compare>&&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  594 |         priority_queue(priority_queue&& __q, const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:594:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:590:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const std::priority_queue<_Tp, _Sequence, _Compare>&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  590 |         priority_queue(const priority_queue& __q, const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:590:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:585:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const _Compare&, _Sequence&&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  585 |         priority_queue(const _Compare& __x, _Sequence&& __c, const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:585:9: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:579:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const _Compare&, const _Sequence&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  579 |         priority_queue(const _Compare& __x, const _Sequence& __c,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:579:9: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:573:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const _Compare&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  573 |         priority_queue(const _Compare& __x, const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:573:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:569:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  569 |         priority_queue(const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:569:9: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:563:7: note: candidate: 'template<class _Tp, class _Sequence, class _Compare> priority_queue(const _Compare&, _Sequence&&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  563 |       priority_queue(const _Compare& __x, _Sequence&& __s = _Sequence())
      |       ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:563:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:558:7: note: candidate: 'template<class _Tp, class _Sequence, class _Compare> priority_queue(const _Compare&, const _Sequence&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  558 |       priority_queue(const _Compare& __x, const _Sequence& __s)
      |       ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:558:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:554:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Seq, class _Requires> priority_queue()-> std::priority_queue<_Tp, _Sequence, _Compare>'
  554 |         priority_queue()
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:554:9: note:   template argument deduction/substitution failed:
a.cc:115:41: note:   couldn't deduce template parameter '_Tp'
  115 |                 status = priority_queue();
      |                                         ^
/usr/include/c++/14/bits/stl_queue.h:496:11: note: candidate: 'template<class _Tp, class _Sequence, class _Compare> priority_queue(std::priority_queue<_Tp, _Sequence, _Compare>)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  496 |     class priority_queue
      |           ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:496:11: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:818:5: note: candidate: 'template<class _Compare, class _Container, class _Allocator, class, class> std::priority_queue(_Compare, _Container, _Allocator)-> priority_queue<typename _Container::value_type, _Container, _Compare>'
  818 |     priority_queue(_Compare, _Container, _Allocator)
      |     ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:818:5: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:811:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Compare, class _Container, class, class, class> std::priority_queue(_InputIterator, _InputIterator, _Compare, _Container)-> priority_queue<_ValT, _Container, _Compare>'
  811 |     priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(),
      |     ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:811:5: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:801:5: note: candidate: 'template<class _Compare, class _Container, class, class> std::priority_queue(_Compare, _Container)-> priority_queue<typename _Container::value_type, _Container, _Compare>'
  801 |     priority_queue(_Compare, _Container)
      |     ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:801:5: note:   candidate expects 2 arguments, 0 provided