Language: C++

#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
using namespace std; 
int main(){
    int n,m,r;
    cin >> n >> m >> r;
    vector <int> R(r);
    vector < vector <int > >  abc(m,vector<int>(3));
    for(int i = 0 ; i < r ; i++){
        cin >> R[i];
    }

    vector < vector <int > > d(n+1,vector<int>(n+1,1000000));
    for(int i = 0 ; i < m ; i++){
        cin >> abc[i][0];
        cin >> abc[i][1];
        cin >> abc[i][2];
        d[ abc[i][0] ][ abc[i][1] ] = abc[i][2]; 
        d[ abc[i][1] ][ abc[i][0] ] = abc[i][2];        
    }
    
    for(int  k = 1 ; k <= n ;k++){
        for(int i = 1 ; i <= n ; i++){
            for(int j = 1 ; j <= n; j++){
                if(d[i][j] > d[i][k] + d[k][j]){
                    d[i][j] = d[i][k] + d[k][j];
                }
            }
        }    
    }

    int cnt = 0;
    int min;
    bool flag1 = true;
    while(cnt < pow(r,r)){
        int load = 0;
        vector<int> loadlist(r);
        vector<int> loadlistsort(r);
        for(int i = 0 ; i < r ;i++){
             loadlist[i] = R[(cnt/ max(r*i,1) )%r];
             //cout << loadlist[i] << " ";
        }
        loadlistsort = loadlist;
        sort(loadlistsort.begin(),loadlistsort.end());
        bool flag = true;

        for(int i = 1 ; i < r ;i++){
            //cout << loadlistsort[i-1] << "," << loadlistsort[i] << " ";
            if(loadlistsort[i-1] == loadlistsort[i]){
                flag = false;
                //cout << " b ";
            }
        }
        for(int i = 0 ; i < r-1 ;i++){
            load += d[loadlist[i]][loadlist[i+1]];
        }
        //cout << load << endl;
        cnt++;
        if(flag && flag1){
            min = load;
            flag1 = false;
        }
        if(load < min && flag){
            min = load;
        }
    }
    cout << min << endl;
    return 0;
}


Compiler output:
a.cc:8:1: error: extended character   is not valid in an identifier
    8 | using namespace std;
      | ^
a.cc:8:1: error: extended character   is not valid in an identifier
a.cc:9:1: error: extended character   is not valid in an identifier
    9 | int main(){
      | ^
a.cc:10:1: error: extended character   is not valid in an identifier
   10 |     int n,m,r;
      | ^
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
   11 |     cin >> n >> m >> r;
      | ^
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:11:11: error: extended character   is not valid in an identifier
   11 |     cin >> n >> m >> r;
      |           ^
a.cc:11:11: error: extended character   is not valid in an identifier
a.cc:11:16: error: extended character   is not valid in an identifier
   11 |     cin >> n >> m >> r;
      |                ^
a.cc:11:16: error: extended character   is not valid in an identifier
a.cc:11:21: error: extended character   is not valid in an identifier
   11 |     cin >> n >> m >> r;
      |                     ^
a.cc:12:1: error: extended character   is not valid in an identifier
   12 |     vector <int> R(r);
      | ^
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:17: error: extended character   is not valid in an identifier
   12 |     vector <int> R(r);
      |                 ^
a.cc:13:1: error: extended character   is not valid in an identifier
   13 |     vector < vector <int > >  abc(m,vector<int>(3));
      | ^
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:13: error: extended character   is not valid in an identifier
   13 |     vector < vector <int > >  abc(m,vector<int>(3));
      |             ^
a.cc:13:13: error: extended character   is not valid in an identifier
a.cc:13:22: error: extended character   is not valid in an identifier
   13 |     vector < vector <int > >  abc(m,vector<int>(3));
      |                      ^
a.cc:13:27: error: extended character   is not valid in an identifier
   13 |     vector < vector <int > >  abc(m,vector<int>(3));
      |                           ^
a.cc:13:29: error: extended character   is not valid in an identifier
   13 |     vector < vector <int > >  abc(m,vector<int>(3));
      |                             ^
a.cc:13:29: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
   14 |     for(int i = 0 ; i < r ; i++){
      | ^
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:9: error: extended character   is not valid in an identifier
   14 |     for(int i = 0 ; i < r ; i++){
      |         ^
a.cc:14:9: error: extended character   is not valid in an identifier
a.cc:14:16: error: extended character   is not valid in an identifier
   14 |     for(int i = 0 ; i < r ; i++){
      |                ^
a.cc:14:16: error: extended character   is not valid in an identifier
a.cc:14:20: error: extended character   is not valid in an identifier
   14 |     for(int i = 0 ; i < r ; i++){
      |                    ^
a.cc:14:20: error: extended character   is not valid in an identifier
a.cc:14:24: error: extended character   is not valid in an identifier
   14 |     for(int i = 0 ; i < r ; i++){
      |                        ^
a.cc:14:24: error: extended character   is not valid in an identifier
a.cc:14:28: error: extended character   is not valid in an identifier
   14 |     for(int i = 0 ; i < r ; i++){
      |                            ^
a.cc:15:1: error: extended character   is not valid in an identifier
   15 |         cin >> R[i];
      | ^
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:15: error: extended character   is not valid in an identifier
   15 |         cin >> R[i];
      |               ^
a.cc:16:1: error: extended character   is not valid in an identifier
   16 |     }
      | ^
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
   18 |     vector < vector <int > > d(n+1,vector<int>(n+1,1000000));
      | ^
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:13: error: extended character   is not valid in an identifier
   18 |     vector < vector <int > > d(n+1,vector<int>(n+1,1000000));
      |             ^
a.cc:18:13: error: extended character   is not valid in an identifier
a.cc:18:22: error: extended character   is not valid in an identifier
   18 |     vector < vector <int > > d(n+1,vector<int>(n+1,1000000));
      |                      ^
a.cc:18:27: error: extended character   is not valid in an identifier
   18 |     vector < vector <int > > d(n+1,vector<int>(n+1,1000000));
      |                           ^
a.cc:18:29: error: extended character   is not valid in an identifier
   18 |     vector < vector <int > > d(n+1,vector<int>(n+1,1000000));
      |                             ^
a.cc:19:1: error: extended character   is not valid in an identifier
   19 |     for(int i = 0 ; i < m ; i++){
      | ^
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:9: error: extended character   is not valid in an identifier
   19 |     for(int i = 0 ; i < m ; i++){
      |         ^
a.cc:19:9: error: extended character   is not valid in an identifier
a.cc:19:16: error: extended character   is not valid in an identifier
   19 |     for(int i = 0 ; i < m ; i++){
      |                ^
a.cc:19:16: error: extended character   is not valid in an identifier
a.cc:19:20: error: extended character   is not valid in an identifier
   19 |     for(int i = 0 ; i < m ; i++){
      |                    ^
a.cc:19:20: error: extended character   is not valid in an identifier
a.cc:19:24: error: extended character   is not valid in an identifier
   19 |     for(int i = 0 ; i < m ; i++){
      |                        ^
a.cc:19:24: error: extended character   is not valid in an identifier
a.cc:19:28: error: extended character   is not valid in an identifier
   19 |     for(int i = 0 ; i < m ; i++){
      |                            ^
a.cc:20:1: error: extended character   is not valid in an identifier
   20 |         cin >> abc[i][0];
      | ^
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:15: error: extended character   is not valid in an identifier
   20 |         cin >> abc[i][0];
      |               ^
a.cc:21:1: error: extended character   is not valid in an identifier
   21 |         cin >> abc[i][1];
      | ^
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:15: error: extended character   is not valid in an identifier
   21 |         cin >> abc[i][1];
      |               ^
a.cc: