Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <bits/stdc++.h>using namespace std;#define x first#define y secondconst int MOD = 1000000007;const int maxn = 1000 + 10;typedef pair<int, int> pii;typedef pair<int, pii> ppi;int n, m, k, a[maxn], b[maxn];int vis[maxn][maxn] ,l[maxn][maxn] , sx, sy, ex, ey, des;int dx[4] = {-1, 0, 0, 1};int dy[4] = {0, -1, 1, 0};int code(int x, int y){return (x - 1) * n + y - 1;}bool legal(int x, int y){return x > 0 && x <= n && y > 0 && y <= m;}int run(){priority_queue<ppi, vector<ppi>, greater<ppi> > q;q.push({0, {sx, sy}});l[sx][sy] = 0;vis[sx][sy] = 1;while (!q.empty()){ppi from = q.top();//printf("%d , %d ---> %d \n", from.y.x, from.y.y, from.x);q.pop();