Language: C++

#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
long long n,m,r,ts[10],dp[202][202],ans=1e18;
int main()
{
	cin>>n>>m>>r;
	for(int i=0;i<r;i++)
	{
		cin>>ts[i];
	}
	memset(dp,1e9,sizeof(dp));
	for(int i=1;i<=200;i++)
	{
		dp[i][i]=0;
	}
	for(int i=1;i<=m;i++)
	{
		int a,b,c;
		cin>>a>>b>>c;
		dp[a][b]=c;
		dp[b][a]=c;
	}
	for(int k=1;k<=n;k++)
	{
		for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=n;j++)
			{
				dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j]);
			}
		}
	}
	sort(ts,ts+r);
	do
	{
		long long cnt=0;
		for(int i=1;i<r;i++)
		{
			cnt+=dp[ts[i-1]][ts[i]];
		}
		ans=min(ans,cnt);
	}
	while(next_permutation(ts,ts+r));
	cout<<ans<<endl;
	return 0;
}#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
long long n,m,r,ts[10],dp[202][202],ans=1e18;
int main()
{
	cin>>n>>m>>r;
	for(int i=0;i<r;i++)
	{
		cin>>ts[i];
	}
	memset(dp,1e9,sizeof(dp));
	for(int i=1;i<=200;i++)
	{
		dp[i][i]=0;
	}
	for(int i=1;i<=m;i++)
	{
		int a,b,c;
		cin>>a>>b>>c;
		dp[a][b]=c;
		dp[b][a]=c;
	}
	for(int k=1;k<=n;k++)
	{
		for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=n;j++)
			{
				dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j]);
			}
		}
	}
	sort(ts,ts+r);
	do
	{
		long long cnt=0;
		for(int i=1;i<r;i++)
		{
			cnt+=dp[ts[i-1]][ts[i]];
		}
		ans=min(ans,cnt);
	}
	while(next_permutation(ts,ts+r));
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:64:2: error: stray '#' in program
   64 | }#include<iostream>
      |  ^
a.cc:64:3: error: 'include' does not name a type
   64 | }#include<iostream>
      |   ^~~~~~~
a.cc:84:11: error: redefinition of 'long long int n'
   84 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |           ^
a.cc:21:11: note: 'long long int n' previously declared here
   21 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |           ^
a.cc:84:13: error: redefinition of 'long long int m'
   84 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |             ^
a.cc:21:13: note: 'long long int m' previously declared here
   21 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |             ^
a.cc:84:15: error: redefinition of 'long long int r'
   84 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |               ^
a.cc:21:15: note: 'long long int r' previously declared here
   21 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |               ^
a.cc:84:17: error: redefinition of 'long long int ts [10]'
   84 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |                 ^~
a.cc:21:17: note: 'long long int ts [10]' previously declared here
   21 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |                 ^~
a.cc:84:24: error: redefinition of 'long long int dp [202][202]'
   84 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |                        ^~
a.cc:21:24: note: 'long long int dp [202][202]' previously declared here
   21 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |                        ^~
a.cc:84:37: error: redefinition of 'long long int ans'
   84 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |                                     ^~~
a.cc:21:37: note: 'long long int ans' previously defined here
   21 | long long n,m,r,ts[10],dp[202][202],ans=1e18;
      |                                     ^~~
a.cc:85:5: error: redefinition of 'int main()'
   85 | int main()
      |     ^~~~
a.cc:22:5: note: 'int main()' previously defined here
   22 | int main()
      |     ^~~~