hiho week 272 register

Ended

Participants:79

Verdict:Accepted
Score:100 / 100
Submitted:2019-09-15 11:34:37

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#define INF 1000000007
using namespace std;
struct pt {
    int i, j, d;
    pt() {}
    pt(int i, int j, int d):i(i), j(j), d(d){}
    bool operator < (const pt& b) const{
        return d > b.d;
    }
};
int main()
{
    int N, M, si, sj, ti, tj;
    cin >> N >> M;
    vector<vector<char>> maze(N, vector<char>(M));
    vector<vector<int>> nd(N, vector<int>(M, INF));
    priority_queue<pt> Q;
    for (int i = 0; i < N; ++i)
        for (int j = 0; j < M; ++j) {
            cin >> maze[i][j];
            if (maze[i][j] == 'S') {
                si = i;
                sj = j;
            }
            if (maze[i][j] == 'T') {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX