Language: C++

;

const int MAX_V = 210;
vector<vector<ll>> d(MAX_V,vector<ll>(MAX_V,INF));
//d[[i][j]:i,j間の最短経路
int E,V; //辺の数，頂点数

void wf(){
	rep(k,0,V)
		rep(i,0,V)
			rep(j,0,V)
				d[i][j] = min(d[i][j] , d[i][k] + d[k][j] );
}

//入力
void make(){
	rep(i,0,E){
		int u,v,c;
		cin>>u>>v>>c;
		u--; v--;
		d[u][v] = c;
		d[v][u] = c;
	}
}

//初期化
void init(){
	rep(i,0,V){
		rep(j,0,V){
			if( i == j ) d[i][j] = 0;
			else d[i][j] = INF;
		}
	}
}

int main(){
	int r;
	cin >> V >> E >> r;
	
	vector<int> v(r);
	rep(i,0,r){	
		cin >> v[i];
		v[i]--;
	}
	init();
	make();
	wf();

	/*
	rep(i,0,V){
		rep(j,0,V){
			cout << d[i][j] <<" ";
		}
		cout << endl;
	}
	*/	
	ll ans = numeric_limits<ll>::max();


	do{
		ll sum = 0;
		int bef = v[0];
		rep(i,1,r){
			//cout << v[i] << " " << bef << " " << d[v[i]][bef] << endl;
			sum += d[v[i]][bef];
			bef = v[i];
		}
		ans = min(ans,sum);
	}while(next_permutation(v.begin(),v.end()));

	cout << ans << endl;
	ret 0;
}

Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<vector<ll>> d(MAX_V,vector<ll>(MAX_V,INF));
      | ^~~~~~
a.cc: In function 'void wf()':
a.cc:9:13: error: 'k' was not declared in this scope
    9 |         rep(k,0,V)
      |             ^
a.cc:9:9: error: 'rep' was not declared in this scope
    9 |         rep(k,0,V)
      |         ^~~
a.cc: In function 'void make()':
a.cc:17:13: error: 'i' was not declared in this scope
   17 |         rep(i,0,E){
      |             ^
a.cc:17:9: error: 'rep' was not declared in this scope
   17 |         rep(i,0,E){
      |         ^~~
a.cc: In function 'void init()':
a.cc:28:13: error: 'i' was not declared in this scope
   28 |         rep(i,0,V){
      |             ^
a.cc:28:9: error: 'rep' was not declared in this scope
   28 |         rep(i,0,V){
      |         ^~~
a.cc: In function 'int main()':
a.cc:38:9: error: 'cin' was not declared in this scope
   38 |         cin >> V >> E >> r;
      |         ^~~
a.cc:40:9: error: 'vector' was not declared in this scope
   40 |         vector<int> v(r);
      |         ^~~~~~
a.cc:40:16: error: expected primary-expression before 'int'
   40 |         vector<int> v(r);
      |                ^~~
a.cc:41:13: error: 'i' was not declared in this scope
   41 |         rep(i,0,r){
      |             ^
a.cc:41:9: error: 'rep' was not declared in this scope
   41 |         rep(i,0,r){
      |         ^~~
a.cc:57:9: error: 'll' was not declared in this scope
   57 |         ll ans = numeric_limits<ll>::max();
      |         ^~
a.cc:61:19: error: expected ';' before 'sum'
   61 |                 ll sum = 0;
      |                   ^~~~
      |                   ;
a.cc:62:27: error: 'v' was not declared in this scope
   62 |                 int bef = v[0];
      |                           ^
a.cc:68:17: error: 'ans' was not declared in this scope
   68 |                 ans = min(ans,sum);
      |                 ^~~
a.cc:68:31: error: 'sum' was not declared in this scope
   68 |                 ans = min(ans,sum);
      |                               ^~~
a.cc:68:23: error: 'min' was not declared in this scope; did you mean 'main'?
   68 |                 ans = min(ans,sum);
      |                       ^~~
      |                       main
a.cc:69:33: error: 'v' was not declared in this scope
   69 |         }while(next_permutation(v.begin(),v.end()));
      |                                 ^
a.cc:69:16: error: 'next_permutation' was not declared in this scope
   69 |         }while(next_permutation(v.begin(),v.end()));
      |                ^~~~~~~~~~~~~~~~
a.cc:71:9: error: 'cout' was not declared in this scope
   71 |         cout << ans << endl;
      |         ^~~~
a.cc:71:17: error: 'ans' was not declared in this scope
   71 |         cout << ans << endl;
      |                 ^~~
a.cc:71:24: error: 'endl' was not declared in this scope
   71 |         cout << ans << endl;
      |                        ^~~~
a.cc:72:9: error: 'ret' was not declared in this scope
   72 |         ret 0;
      |         ^~~