Language: C++

#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64
//#define ll long long
int n,m,r;
int G[500][500];
ll d[500][500];

vector<int>visit;
ll ans;
 
const ll INF=1000000000;
 
int main(){
cin>>n>>m>>r;
 
ll a,b,c;
visit.resize(r);
rep(i,r){
	cin>>a;
	a--;
	visit[i]=a;
}
 
rep(i,n){
	rep(j,n){
		if(i==j)d[i][j]=0;
		else d[i][j]=INF;
	}
}
 
rep(i,m){
	cin>>a>>b>>c;
	a--;b--;
	cout<<i<<endl;
	if(d[a][b]>c){
	d[a][b]=c;d[b][a]=c;
	}
}
 
rep(k,n){
	rep(i,n){
		rep(j,n)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
	}
}
 
ans=100000000000000000;

do{
	ll tmp=0;
	for(int i=1;i<r;i++)tmp+=d[visit[i-1]][visit[i]];
	ans=min(ans,tmp);
}while(next_permutation(visit.begin(),visit.end()));
 
cout<<ans<<endl;
 
 
	return 0;
}

Compiler output:
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:20:1: note: in expansion of macro 'll'
   20 | ll d[500][500];
      | ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:23:1: note: in expansion of macro 'll'
   23 | ll ans;
      | ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:25:7: note: in expansion of macro 'll'
   25 | const ll INF=1000000000;
      |       ^~
a.cc: In function 'int main()':
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:30:1: note: in expansion of macro 'll'
   30 | ll a,b,c;
      | ^~
a.cc:33:14: error: 'a' was not declared in this scope
   33 |         cin>>a;
      |              ^
a.cc:40:25: error: 'd' was not declared in this scope
   40 |                 if(i==j)d[i][j]=0;
      |                         ^
a.cc:41:22: error: 'd' was not declared in this scope
   41 |                 else d[i][j]=INF;
      |                      ^
a.cc:41:30: error: 'INF' was not declared in this scope
   41 |                 else d[i][j]=INF;
      |                              ^~~
a.cc:46:14: error: 'a' was not declared in this scope
   46 |         cin>>a>>b>>c;
      |              ^
a.cc:46:17: error: 'b' was not declared in this scope
   46 |         cin>>a>>b>>c;
      |                 ^
a.cc:46:20: error: 'c' was not declared in this scope
   46 |         cin>>a>>b>>c;
      |                    ^
a.cc:49:12: error: 'd' was not declared in this scope
   49 |         if(d[a][b]>c){
      |            ^
a.cc:56:25: error: 'd' was not declared in this scope
   56 |                 rep(j,n)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
      |                         ^
a.cc:60:1: error: 'ans' was not declared in this scope; did you mean 'abs'?
   60 | ans=100000000000000000;
      | ^~~
      | abs
a.cc:63:12: error: expected ';' before 'tmp'
   63 |         ll tmp=0;
      |            ^~~
a.cc:64:29: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   64 |         for(int i=1;i<r;i++)tmp+=d[visit[i-1]][visit[i]];
      |                             ^~~
      |                             tm
a.cc:64:34: error: 'd' was not declared in this scope
   64 |         for(int i=1;i<r;i++)tmp+=d[visit[i-1]][visit[i]];
      |                                  ^
a.cc:65:21: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   65 |         ans=min(ans,tmp);
      |                     ^~~
      |                     tm