Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <array>
#include <vector>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#include <complex>
#include <bitset>
#define full(c) c.begin(), c.end()
#define vector2d(name,type,h,w,init) vector<vector<type>> name(h,vector<type>(w,init)) 
const int PRIME = 1000000007;
const int INT_INF = 2147483647;
const long long int LL_INF = 9223372036854775807;
const double PI = acos(-1);
const double EPS = 0.0001;
typedef unsigned long long int ull;
typedef long long int ll;
using namespace std;

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	const ll INF = 100100100100
	ll k, i, j, n, m, r, d[10], md[210][210], least = INF;
	for (i = 0; i < 200; i++) {
		for (j = 0; j < 200; j++) {
			if (i == j) md[i][j] = 0;
			else md[i][j] = INF;
		}
	}
	cin >> n >> m >> r;
	for (i = 0; i < r; i++) {
		cin >> d[i];
		d[i]--;
	}
	for (i = 0; i < m; i++) {
		ll a, b, c;
		cin >> a >> b >> c;
		a--;
		b--;
		md[a][b] = c;
		md[b][a] = c;
	}
	for (k = 0; k < n; k++) {
		for (i = 0; i < n; i++) {
			for (j = 0; j < n; j++) {
				md[i][j] = min(md[i][j], md[i][k] + md[k][j]);
			}
		}
	}
	do {
		ll cnt = 0;
		for (i = 0; i < r - 1; i++) {
			if (md[d[i]][d[i + 1]] == INF) break;
			cnt += md[d[i]][d[i + 1]];
		}
		if (i == r - 1) {
			least = min(least, cnt);
		}
	} while (next_permutation(d, d + r));
	cout << least << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: expected ',' or ';' before 'll'
   37 |         ll k, i, j, n, m, r, d[10], md[210][210], least = INF;
      |         ^~
a.cc:38:14: error: 'i' was not declared in this scope
   38 |         for (i = 0; i < 200; i++) {
      |              ^
a.cc:39:22: error: 'j' was not declared in this scope; did you mean 'jn'?
   39 |                 for (j = 0; j < 200; j++) {
      |                      ^
      |                      jn
a.cc:40:37: error: 'md' was not declared in this scope
   40 |                         if (i == j) md[i][j] = 0;
      |                                     ^~
a.cc:41:30: error: 'md' was not declared in this scope
   41 |                         else md[i][j] = INF;
      |                              ^~
a.cc:44:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   44 |         cin >> n >> m >> r;
      |                ^
      |                yn
a.cc:44:21: error: 'm' was not declared in this scope; did you mean 'tm'?
   44 |         cin >> n >> m >> r;
      |                     ^
      |                     tm
a.cc:44:26: error: 'r' was not declared in this scope
   44 |         cin >> n >> m >> r;
      |                          ^
a.cc:45:14: error: 'i' was not declared in this scope
   45 |         for (i = 0; i < r; i++) {
      |              ^
a.cc:46:24: error: 'd' was not declared in this scope
   46 |                 cin >> d[i];
      |                        ^
a.cc:49:14: error: 'i' was not declared in this scope
   49 |         for (i = 0; i < m; i++) {
      |              ^
a.cc:54:17: error: 'md' was not declared in this scope
   54 |                 md[a][b] = c;
      |                 ^~
a.cc:57:14: error: 'k' was not declared in this scope
   57 |         for (k = 0; k < n; k++) {
      |              ^
a.cc:58:22: error: 'i' was not declared in this scope
   58 |                 for (i = 0; i < n; i++) {
      |                      ^
a.cc:59:30: error: 'j' was not declared in this scope; did you mean 'jn'?
   59 |                         for (j = 0; j < n; j++) {
      |                              ^
      |                              jn
a.cc:60:33: error: 'md' was not declared in this scope
   60 |                                 md[i][j] = min(md[i][j], md[i][k] + md[k][j]);
      |                                 ^~
a.cc:66:22: error: 'i' was not declared in this scope
   66 |                 for (i = 0; i < r - 1; i++) {
      |                      ^
a.cc:67:29: error: 'md' was not declared in this scope
   67 |                         if (md[d[i]][d[i + 1]] == INF) break;
      |                             ^~
a.cc:67:32: error: 'd' was not declared in this scope
   67 |                         if (md[d[i]][d[i + 1]] == INF) break;
      |                                ^
a.cc:68:32: error: 'md' was not declared in this scope
   68 |                         cnt += md[d[i]][d[i + 1]];
      |                                ^~
a.cc:68:35: error: 'd' was not declared in this scope
   68 |                         cnt += md[d[i]][d[i + 1]];
      |                                   ^
a.cc:70:21: error: 'i' was not declared in this scope
   70 |                 if (i == r - 1) {
      |                     ^
a.cc:71:25: error: 'least' was not declared in this scope
   71 |                         least = min(least, cnt);
      |                         ^~~~~
a.cc:73:35: error: 'd' was not declared in this scope
   73 |         } while (next_permutation(d, d + r));
      |                                   ^
a.cc:74:17: error: 'least' was not declared in this scope
   74 |         cout << least << endl;
      |                 ^~~~~