Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define endl '\n'
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define fr first
#define sc second
const ll mod = 1000000007;
const double PI = 3.141592653589793238463;
const int N=3e5+10;
int city[201];
int dis[201];
bool visited[201];
bool op[201];
vector<pair<int,int>>v[201];
int main()
{
    FASTINOUT;
    int n,m,r;
    cin>>n>>m>>r;
    for (int i=1;i<=r;i++)
        cin>>city[i];
    int c1,c2,val;
    for (int i=0;i<m;i++){
        cin>>c1>>c2>>val;
        v[c1].push_back({c2,val});
        v[c2].push_back({c1,val});
    }
    int ans=1e9;
    for (int i=1;i<=n;i++){
        multiset<pair<int,int>>st;
        fill(dis,dis+201,100000000);
        fill(visited,visited+201,false);
        dis[city[i]]=0;
        st.insert({0,city[i]});
        while (!st.empty()){
            pair<int,int>temp=*st.begin();
            st.erase(st.begin());
            int f=temp.fr;
            int s=temp.sc;
            if (visited[s])
                continue;
            visited[s]=true;
            for (int j=0;j<v[s].size();j++){
                if (dis[s]+v[s][j].sc<dis[v[s][j].fr]){
                    dis[v[s][j].fr]=dis[s]+v[s][j].sc;
                    st.insert({dis[v[s][j].fr],v[s][j].fr});
                }
            }
        }
        ll sum=0;
        for (int j=1;j<=r;j++){
            sum+=dis[city[j]];
        }
        ans=min(ans,sum);
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:16: error: no matching function for call to 'min(int&, long long int&)'
   55 |         ans=min(ans,sum);
      |             ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:55:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   55 |         ans=min(ans,sum);
      |             ~~~^~~~~~~~~
/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:
/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:55:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   55 |         ans=min(ans,sum);
      |             ~~~^~~~~~~~~