Language: C++

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;

vector<int>x[4000];
long long n,m,a,b,c,k,G;
long long s[4000],d[4000];
long long X[4000];
double maxn;int res;

int main(){
	memset(X,63,sizeof(X));
	cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		cin>>a>>b>>c;
		x[a].push_back(b*1000000+c);
		x[b].push_back(a*1000000+c);
	}
	for(int i=0;i<k;i++){
		cin>>a;
		s[a]=1;
	}
	for(int i=1;i<=n;i++){
		if(s[i]==1){
			memset(d,63,sizeof(d));
			d[i]=0;
			if(n<500){G=n;}
			else{G=max(20,(n+k)/k+10);}
			for(int h=1;h<=G;h++){
				for(int j=1;j<=n;j++){
					if(d[j]<1000000000){
						for(int k=0;k<x[j].size();k++){
							d[x[j][k]/1000000]=min(d[x[j][k]/1000000],d[j]+x[j][k]%1000000);
						}
					}
				}
			}
			for(int j=1;j<=n;j++){
				X[j]=min(X[j],d[j]);
			}
		}
	}
	for(int i=1;i<=n;i++){
		maxn=max((long long)maxn,X[i]);
	}
	for(int i=1;i<=n;i++){
		for(int j=0;j<x[i].size();j++){
			if(abs(X[i]-X[x[i][j]/1000000])<x[i][j]%1000000){
				a=x[i][j]%1000000-abs(X[i]-X[x[i][j]/1000000]);
				maxn=max(maxn,(double)(max(X[i],X[(int)(x[i][j]/1000000)])+1.0*a/2.0));
			}
		}
	}
	res=(1.0*maxn+0.99999999);
	cout<<res<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:35: error: no matching function for call to 'max(int, long long int)'
   31 |                         else{G=max(20,(n+k)/k+10);}
      |                                ~~~^~~~~~~~~~~~~~~
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: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:31:35: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   31 |                         else{G=max(20,(n+k)/k+10);}
      |                                ~~~^~~~~~~~~~~~~~~
/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:3:
/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:31:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   31 |                         else{G=max(20,(n+k)/k+10);}
      |                                ~~~^~~~~~~~~~~~~~~