Language: C++

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr int MOD = 1000000000 + 7;
constexpr int INF = 2000000000;
const double PI = acos(-1);

const int MAX_V = 202;
int d[MAX_V][MAX_V];//d[i][j]はe={u,v}のコスト
int V;

void warshall_floyd() {
	for (int k = 0; k<V; k++) {
		for (int i = 0; i<V; i++) {
			for (int j = 0; j<V; j++) {
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
}
void first() {
	for (int i = 0; i < MAX_V; i++) {
		for (int j = 0; j < MAX_V; j++) {
			if (i == j)d[i][j] = 0;
			else d[i][j] = INF;
		}
	}
}
int main() {
	first();
	int N, M, R;
	cin >> N >> M >> R;
	int a, b, c;
	vector<int> v;
	V = N;
	int r;
	for (int i = 0; i < R; i++) {
		cin >> r;
		v.emplace_back(r - 1);
	}
	for (int i = 0; i < M; i++) {
		cin >> a >> b >> c;
		a--, b--;
		if (d[a][b] < c) continue;
		d[a][b] = c;
		d[b][a] = c;
	}
	sort(v.begin(), v.end());
	warshall_floyd();
	LL ans = INF;
	do {
		int num = 0;
		for (int i = 0; i < R - 1; i++) {
			num += d[v[i]][v[i + 1]];
		}
		ans = min(num, ans);
	} while (next_permutation(v.begin(), v.end()));
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:26: error: no matching function for call to 'min(int&, LL&)'
   68 |                 ans = min(num, ans);
      |                       ~~~^~~~~~~~~~
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:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'LL' {aka 'long long int'})
   68 |                 ans = min(num, ans);
      |                       ~~~^~~~~~~~~~
/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:2:
/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:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   68 |                 ans = min(num, ans);
      |                       ~~~^~~~~~~~~~