Language: C++

#include <bits/stdc++.h>
#define FOR(i,a,b) for(LL i=(a);i<(LL)(b);i++)
#define REP(i,b) FOR(i,0,b)
#define ALL(c) c.begin(),c.end()
#define PB push_back
#define FF first
#define SS second
#define cat //cout << __LINE__ << endl;
using namespace std;
typedef long long LL;
typedef double ld;
typedef LL ut;
typedef vector<ut> VI;
typedef pair<ut,ut> pr;
typedef pair<ut,pr> ppr;
typedef vector<pr> Vpr;
typedef vector<ppr> Vppr;
typedef priority_queue<pr,Vpr,greater<pr> > PQ;
const ut INF=1LL<<30;
const int SIZE=5+1e5;
map<LL,LL> searched;
Vpr edge[SIZE];
VI miniumed[SIZE];
LL minium[SIZE];
LL p[SIZE],q[SIZE],c[SIZE];
int main(){
	int N,M;
	cin.tie(0);
	cin >> N >> M;
	FOR(i,1,N+1) minium[i]=INF;
	REP(i,M){
		cin >> p[i] >> q[i] >> c[i];
		edge[p[i]].PB(pr(c[i],q[i]));
		edge[q[i]].PB(pr(c[i],p[i]));
	}
	FOR(i,1,N+1){
		sort(ALL(edge[i]));
		edge[i].PB(INF);
	}
	PQ qu;
	qu.push(pr(0,1));
	while(!qu.empty()){
		LL dist=qu.top().first,now=qu.top().second;
		qu.pop();
		if(searched[now]) continue;
		searched[now]=true;
		sort(ALL(miniumed[now]));
		int ces=0;
		REP(i,edge[now].size()){
			int next=edge[now][i].second;
			int nuse=edge[now][i].first;
			while(miniumed[now][ces]<nuse) ces++;
			LL ndist=dist+(nuse!=miniumed[now][ces]);
			if(minium[next]>=ndist){
				if(minium[next]>ndist)
					miniumed[next].clear();
				minium[next]=ndist;
				miniumed[next].PB(nuse);
				qu.push(pr(ndist,next));
			}
		}
	}
	if(minium[N]==INF) cout << -1 << endl;
    else cout << minium[N] << endl;
	

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:27: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(const ut&)'
   38 |                 edge[i].PB(INF);
      |                 ~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'const ut' {aka 'const long long int'} to 'const std::vector<std::pair<long long int, long long int> >::value_type&' {aka 'const std::pair<long long int, long long int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'const ut' {aka 'const long long int'} to 'std::vector<std::pair<long long int, long long int> >::value_type&&' {aka 'std::pair<long long int, long long int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~