Language: C++

//A,Elebereth Gilthoniel mantae!
//For Temeria!
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<cstdio>
#include<map>
#include<stack>
#include<queue>
#include<cstring> 
using namespace std;
const long long maxn=2e6+1e5;
vector<pair<long long,long long> > v[maxn];vector<long long> col[maxn];long long vis[maxn];
long long bark[maxn];vector<long long> qzr[maxn];long long ful;
long long dis[maxn];
int main()
{
	long long n,m;cin>>n>>m;
	for(long long i=0;i<m;i++)
	{
		long long a,b,c;cin>>a>>b>>c;
		v[a].push_back(make_pair(c,b));v[b].push_back(make_pair(c,a));
		col[c].push_back(a);col[c].push_back(b);
	} 
	for(long long i=1;i<=n;i++)
	{
		sort(v[i].begin(),v[i].end());
	}
	ful=1e6+5;
	for(long long asd=1;asd<=1e6+500;asd++)
	{
		if(col[asd].size()==0) continue;
		for(long long it=0;it<col[asd].size();it++)
		{
			long long  p=col[asd][it];
			if(vis[p]==asd) continue;
			queue<long long> q;vector<long long> kl;kl.clear();
			q.push(p);vis[p]=asd;kl.push_back(p);
			while(!q.empty())
			{
				if(q.size()==0) break; 
				long long t=q.front();q.pop();
				for(long long i=max(bark[t]-10,0);i<v[t].size();i++)
				{
					pair<long long,long long> u=v[t][i];
					if(vis[u.second]==asd) continue;
					if(u.first>asd)
					{
						bark[t]=i;break;
					}	
					if(u.first<asd)
					{
						continue;
						//bark[t]=i;break;
					}
					kl.push_back(u.second);q.push(u.second);vis[u.second]=asd;
				}
			}
			for(long long i=0;i<kl.size();i++)
			{
			//	cout<<kl[i]<<" ";
				long long t=kl[i];qzr[t].push_back(ful),qzr[ful].push_back(t);
			}//cout<<"\n";
			ful++;
		}
	}
	memset(dis,-1,sizeof(dis));
	priority_queue<pair<long long,long long> > q;
	q.push(make_pair(-0,1));dis[1]=0;
	while(!q.empty())
	{
		if(q.size()==0) break; 
		long long t=(q.top()).second;q.pop();	
		for(long long i=0;i<qzr[t].size();i++)
		{
			long long j=qzr[t][i];
			if(dis[j]==-1)
			{
				dis[j]=dis[t]+1;q.push(make_pair(-dis[j],j));
			}

		}
	}
	if(dis[n]==-1) dis[n]--;
	cout<<dis[n]/2;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:52: error: no matching function for call to 'max(long long int, int)'
   46 |                                 for(long long i=max(bark[t]-10,0);i<v[t].size();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:3:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:46:52: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   46 |                                 for(long long i=max(bark[t]-10,0);i<v[t].size();i++)
      |                                                 ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:46:52: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   46 |                                 for(long long i=max(bark[t]-10,0);i<v[t].size();i++)
      |                                                 ~~~^~~~~~~~~~~~~~