Language: C++

#include<iostream>
#include<cstdio>  
#include<cstring>  
#include<algorithm>  
using namespace std;  
typedef long long ll;  
const ll inf=0x1f1f1f1f1f1f1f1f;.   
const ll maxn=205;  
ll land[maxn][maxn],sea[maxn][maxn],num[maxn*5],cost[maxn*5][maxn];  
void init(int n)  
{  
    memset(land,inf,sizeof(land));  
    memset(sea,inf,sizeof(sea));  
    memset(cost,inf,sizeof(cost));  
    for(ll i=1;i<=n;++i)  
    {  
        sea[i][i]=land[i][i]=0;  
    }  
}  
ll slove(ll n,ll m,ll w)  
{  
    for(ll k=1;k<=n;++k) 
    {  
        for(ll i=1;i<=n;++i)  
        {  
            for(ll j=1;j<=n;++j)  
            {  
                sea[i][j]=min(sea[i][j],sea[i][k]+sea[k][j]);  
                land[i][j]=min(land[i][j],land[i][k]+land[k][j]);  
            }  
        }  
    }  
    cost[1][num[1]]=0;  
    for(ll i=1;i<=w;++i) 
    {  
        for(ll j=1;j<=n;++j)  
        {  
            cost[i][j]=min(cost[i][j],cost[i-1][j]+land[num[i-1]][num[i]]);  
            for(ll k=1;k<=n;++k)
            {  
                cost[i][k]=min(cost[i][k],  
                cost[i-1][j]+land[num[i-1]][j]+sea[j][k]+land[k][num[i]]);  
            }  
        }  
    }  
    ll ans=inf;  
    for(ll i=1;i<=n;++i) 
    {  
        ans=min(ans,cost[w][i]);  
    }  
    return ans;  
}  
int main()  
{  
    ll n,m;  
    while(scanf("%lld%lld",&n,&m),n|m)  
    {  
        init(n);  
        for(ll i=0;i<m;++i)  
        {  
            ll a,b,c;char ch[10];  
            scanf("%lld%lld%lld%s",&a,&b,&c,ch);  
            if(ch[0]=='S')  
            {  
                sea[a][b]=sea[b][a]=min(sea[a][b],c);  
            }  
            else  
            {  
                land[a][b]=land[b][a]=min(land[a][b],c);  
            }  
        }  
        ll w;  
        scanf("%lld",&w);  
        for(ll i=1;i<=w;++i)  
        {  
            scanf("%lld",&num[i]);
        }  
        printf("%lld\n",slove(n,m,w));  
    }  
    return 0;  
} 

Compiler output:
a.cc:7:33: error: expected unqualified-id before '.' token
    7 | const ll inf=0x1f1f1f1f1f1f1f1f;.
      |                                 ^
a.cc:9:9: error: 'maxn' was not declared in this scope
    9 | ll land[maxn][maxn],sea[maxn][maxn],num[maxn*5],cost[maxn*5][maxn];
      |         ^~~~
a.cc:9:15: error: 'maxn' was not declared in this scope
    9 | ll land[maxn][maxn],sea[maxn][maxn],num[maxn*5],cost[maxn*5][maxn];
      |               ^~~~
a.cc:9:25: error: 'maxn' was not declared in this scope
    9 | ll land[maxn][maxn],sea[maxn][maxn],num[maxn*5],cost[maxn*5][maxn];
      |                         ^~~~
a.cc:9:31: error: 'maxn' was not declared in this scope
    9 | ll land[maxn][maxn],sea[maxn][maxn],num[maxn*5],cost[maxn*5][maxn];
      |                               ^~~~
a.cc:9:41: error: 'maxn' was not declared in this scope
    9 | ll land[maxn][maxn],sea[maxn][maxn],num[maxn*5],cost[maxn*5][maxn];
      |                                         ^~~~
a.cc:9:54: error: 'maxn' was not declared in this scope
    9 | ll land[maxn][maxn],sea[maxn][maxn],num[maxn*5],cost[maxn*5][maxn];
      |                                                      ^~~~
a.cc:9:62: error: 'maxn' was not declared in this scope
    9 | ll land[maxn][maxn],sea[maxn][maxn],num[maxn*5],cost[maxn*5][maxn];
      |                                                              ^~~~
a.cc: In function 'void init(int)':
a.cc:12:12: error: 'land' was not declared in this scope; did you mean 'rand'?
   12 |     memset(land,inf,sizeof(land));
      |            ^~~~
      |            rand
a.cc:13:12: error: 'sea' was not declared in this scope
   13 |     memset(sea,inf,sizeof(sea));
      |            ^~~
a.cc:14:12: error: 'cost' was not declared in this scope; did you mean 'const'?
   14 |     memset(cost,inf,sizeof(cost));
      |            ^~~~
      |            const
a.cc: In function 'll slove(ll, ll, ll)':
a.cc:28:17: error: 'sea' was not declared in this scope
   28 |                 sea[i][j]=min(sea[i][j],sea[i][k]+sea[k][j]);
      |                 ^~~
a.cc:29:17: error: 'land' was not declared in this scope; did you mean 'rand'?
   29 |                 land[i][j]=min(land[i][j],land[i][k]+land[k][j]);
      |                 ^~~~
      |                 rand
a.cc:33:5: error: 'cost' was not declared in this scope; did you mean 'const'?
   33 |     cost[1][num[1]]=0;
      |     ^~~~
      |     const
a.cc:33:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   33 |     cost[1][num[1]]=0;
      |             ^~~
      |             enum
a.cc:38:52: error: 'land' was not declared in this scope; did you mean 'rand'?
   38 |             cost[i][j]=min(cost[i][j],cost[i-1][j]+land[num[i-1]][num[i]]);
      |                                                    ^~~~
      |                                                    rand
a.cc:42:48: error: 'sea' was not declared in this scope
   42 |                 cost[i-1][j]+land[num[i-1]][j]+sea[j][k]+land[k][num[i]]);
      |                                                ^~~
a.cc: In function 'int main()':
a.cc:65:17: error: 'sea' was not declared in this scope
   65 |                 sea[a][b]=sea[b][a]=min(sea[a][b],c);
      |                 ^~~
a.cc:69:17: error: 'land' was not declared in this scope; did you mean 'rand'?
   69 |                 land[a][b]=land[b][a]=min(land[a][b],c);
      |                 ^~~~
      |                 rand
a.cc:76:27: error: 'num' was not declared in this scope; did you mean 'enum'?
   76 |             scanf("%lld",&num[i]);
      |                           ^~~
      |                           enum