Language: C++

//
//  AOJ 2200 Mr. Rito Post Office
//
//  Created by TaoSama on 2015-03-20
//  Copyright (c) 2015 TaoSama. All rights reserved.
//
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <vector>
#define CLR(x,y) memset(x, y, sizeof(x))

using namespace std;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;

int sea[205][205], land[205][205], dp[205][205];
int n, m, r, a[1005];

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
    ios_base::sync_with_stdio(0);

    while(cin >> n >> m && (n + m)) {
        for(int i = 1; i <= n; ++i)
            for(int j = 1; j <= n; ++j)
                sea[i][j] = land[i][j] = i == j ? 0 : INF;

        for(int i = 1; i <= m; ++i) {
            int x, y, t; char c;
            cin >> x >> y >> t >> c;
            if(c == 'S') sea[x][y] = sea[y][x] = min(sea[x][y], t);
            else land[x][y] = land[y][x] = min(land[x][y], t);
        }

        cin >> r;
        for(int i = 1; i <= r; ++i)  cin >> a[i];

        //Floyd
        for(int k = 1; k <= n; ++k) {
            for(int i = 1; i <= n; ++i) {
                for(int 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]);
                }
            }
        }

        /*dp[i][j]:= 蛻ー霎セi髟?ュ?闊ケ蛛懷惠j髟?ュ千噪譛?ー乗慮髣エ */
        memset(dp, 0x3f, sizeof dp);
        dp[1][a[1]] = 0;
        for(int i = 1; i <= r; ++i) {
            for(int j = 1; j <= n; ++j) {
                /*荳?ョ壼庄莉・襍ー髯?キッ*/
                dp[i][j] = min(dp[i][j], dp[i - 1][j] + dp[a[i - 1]][a[i]]);
                for(int k = 1; k <= n; ++k) /*//譫壻クセ豌エ霍ッ闊ケ蛛懃噪菴咲スョ */
                   /*//莉司-1髟?ュ仙屓蛻ー闊ケ蝨ィ逧?  蠑?飴蛻ーk髟?ュ占飴荳「蝨ィ驍」驥? 髯?キッ莉嗣蛻ーi髟?ュ?                    //荳我クェINF 蜿ッ閭ス蜉??縲ゅ?縲ゅ?縲?/
                    dp[i][k] = min((long long)dp[i][k], (long long)dp[i - 1][j] +
                                   land[a[i - 1]][j] + sea[j][k] + land[k][a[i]]);
            }
        }
        cout << *min_element(dp[r], dp[r] + n + 1) << endl;
    }
    return 0;
}

Compiler output:
a.cc:70:20: error: unterminated comment
   70 |                    /*//莉司-1髟?ュ仙屓蛻ー闊ケ蝨ィ逧?  蠑?飴蛻ーk髟?ュ占飴荳「蝨ィ驍」驥? 髯?キッ莉嗣蛻ーi髟?ュ?                    //荳我クェINF 蜿ッ閭ス蜉??縲ゅ?縲ゅ?縲?/
      |                    ^
a.cc: In function 'int main()':
a.cc:69:44: error: expected statement at end of input
   69 |                 for(int k = 1; k <= n; ++k) /*//譫壻クセ豌エ霍ッ闊ケ蛛懃噪菴咲スョ */
      |                                            ^
a.cc:69:44: error: expected '}' at end of input
a.cc:66:41: note: to match this '{'
   66 |             for(int j = 1; j <= n; ++j) {
      |                                         ^
a.cc:69:44: error: expected '}' at end of input
   69 |                 for(int k = 1; k <= n; ++k) /*//譫壻クセ豌エ霍ッ闊ケ蛛懃噪菴咲スョ */
      |                                            ^
a.cc:65:37: note: to match this '{'
   65 |         for(int i = 1; i <= r; ++i) {
      |                                     ^
a.cc:69:44: error: expected '}' at end of input
   69 |                 for(int k = 1; k <= n; ++k) /*//譫壻クセ豌エ霍ッ闊ケ蛛懃噪菴咲スョ */
      |                                            ^
a.cc:37:37: note: to match this '{'
   37 |     while(cin >> n >> m && (n + m)) {
      |                                     ^
a.cc:69:44: error: expected '}' at end of input
   69 |                 for(int k = 1; k <= n; ++k) /*//譫壻クセ豌エ霍ッ闊ケ蛛懃噪菴咲スョ */
      |                                            ^
a.cc:30:12: note: to match this '{'
   30 | int main() {
      |            ^