Language: C++

//https://atcoder.jp/contests/abc073/tasks/abc073_d
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,ll> pll;
typedef pair<int,pint> ppint;
typedef pair<ll,pll> ppll;
typedef vector<int> vint;
typedef vector<ll> vll;

const double pi=3.141592653589793;
const int INF10 = 1000000001;
const ll INF15 = 1e15 +1;
const long long INF18 = 1e18 + 1;
const int mod = 1000000007;
//const int mod = 998244353;
const double EPS=0.00001;

#define rep(i, n) for (int i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (ll)(n); i++)
#define rep2(i,start,end) for(int i=(ll)start;i<=(ll)end;i++)
#define vrep(i, n) for(int i=(ll)n-1;i>=0;i--)
#define vrep1(i, n) for(int i=(ll)n;i>0;i--)
#define all(n) n.begin(),n.end()
#define pb push_back
#define debug(x) cerr << #x <<": " << x << '\n'
#define arep(it,a) for(auto it : a )

struct edge{
    edge(int s,int e,long long c){
        to=e;from=s;cost=c;
    }
    edge(int i,long long c=1){
        edge(-1,i,c);
    }
    int from;
    int to;
    long cost;
};
typedef vector<edge> edges;

//bを何回足せばaを超えるか(O(a/b))
//a+b-1/bとすればよし

//2進数表示したときの最高桁(O(log n))
int bi_max(long n){
    int m = 0;
    for (m; (1 << m) <= n; m++);
    m = m - 1;
    return m;
}
//bi_eに二進数表示したやつを代入(O(log^2 n))
//bitset<N> a(n)でnの二進数表示が得られて、a[i]=0or1でi番目のfragが立ってるかわかる
//x^n mod m (nが負の時は０)(O(log n))
long myPow(long x, long n, long m=mod){
    if (n < 0)
        return 0;
    if (n == 0)
        return 1;
    if (n % 2 == 0)
        return myPow(x * x % m, n / 2, m);
    else
        return x * myPow(x, n - 1, m) % m;
}
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
struct mint{
    ll x; // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint &operator+=(const mint a)
    {
        if ((x += a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator-=(const mint a)
    {
        if ((x += mod - a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator*=(const mint a)
    {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const
    {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint &operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
    bool operator!=(const int a) { return this->x!=a; }
     bool operator==(const int a) { return this->x==a; }
};
istream &operator>>(istream &is, const mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination{
    vector<mint> fact, ifact;
    combination(int n) : fact(n + 1), ifact(n + 1)
    {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i)
            fact[i] = fact[i - 1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i)
            ifact[i - 1] = ifact[i] * i;
    }
    mint operator()(int n, int k)
    {
        if (k < 0 || k > n)
            return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
};
ll fact(int i){if(i<=1)return 1;else return i*fact(i-1);}
template<class T>
bool maxin (T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>
bool minin (T &a,T b){if(a>b){a=b;return 1;}return 0;}
template<class M,class N> 
constexpr common_type_t<M,N> gcd(M a,N b){
    a=abs(a);b=abs(b);
    if(a < b) return gcd(b, a);
    M r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}
template<class M,class N>
constexpr common_type_t<M,N> lcm(M a,N b){
    return a*b/gcd(a,b);
}

const int N_MAX=100005;
int n,m,r;
vint rr;
int v[201][201];
vector<vll> dp(201,vint(201,INF10));

void Main(){
    int x=0,y=INF10,z=1;
    //入力
    cin>>n>>m>>r;
    rr.resize(r);
    rep(i,r)cin>>rr[i];
    rep(i,m){
        cin>>x>>y>>z;
        dp[x-1][y-1]=z;
        dp[y-1][x-1]=z;
    }
    //処理
    rep(k,n){
        rep(i,n){
            rep(j,n){
                minin(dp[i][j],dp[i][k]+dp[k][j]);
            }
        }
    }
    ll ans=INF10;
    do{
        ll mn=0;
        rep(i,r-1){
            mn+=dp[rr[i]-1][rr[i+1]-1];
        }
        minin(ans,mn);
    }while(next_permutation(all(rr)));
    //出力
    cout << ans <<endl;
}

int main(){
    cin.tie(nullptr);
    cout<<fixed<<setprecision(12);
    Main();
}

Compiler output:
a.cc:162:35: error: no matching function for call to 'std::vector<std::vector<long long int> >::vector(int, vint)'
  162 | vector<vll> dp(201,vint(201,INF10));
      |                                   ^
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:2:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >]'
  707 |         vector(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note:   template argument deduction/substitution failed:
a.cc:162:35: note:   deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<int>')
  162 | vector<vll> dp(201,vint(201,INF10));
      |                                   ^
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; allocator_type = std::allocator<std::vector<long long int> >]'
  678 |       vector(initializer_list<value_type> __l,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:43: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<std::vector<long long int> >'
  678 |       vector(initializer_list<value_type> __l,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<long long int> >]'
  659 |       vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:23: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::vector<long long int> >&&'
  659 |       vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
      |              ~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; allocator_type = std::allocator<std::vector<long long int> >; std::false_type = std::false_type]'
  640 |       vector(vector&& __rv, const allocator_type& __m, false_type)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; allocator_type = std::allocator<std::vector<long long int> >; std::true_type = std::true_type]'
  635 |       vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<long long int> >]'
  624 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:28: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<long long int> >&'
  624 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |              ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >]'
  620 |       vector(vector&&) noexcept = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >]'
  601 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int; value_type = std::vector<long long int>; allocator_type = std::allocator<std::vector<long long int> >]'
  569 |       vector(size_type __n, const value_type& __value,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:47: note:   no known conversion for argument 2 from 'vint' {aka 'std::vector<int>'} to 'const std::vector<std::vector<long long int> >::value_type&' {aka 'const std::vector<long long int>&'}
  569 |       vector(size_type __n, const value_type& __value,
      |                             ~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<long long int> >]'
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:51: note:   no known conversion for argument 2 from 'vint' {aka 'std::vector<int>'} to 'const std::vector<std::vector<long long int> >::allocator_type&' {aka 'const std::allocator<std::vector<long long int> >&'}
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |                             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; allocator_type = std::allocator<std::vector<long long int> >]'
  542 |       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >]'
  531 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note:   candidate expects 0 arguments, 2 provided