哈哈哈哈哈哈哈哈哈哈哈哈哈哈
我终于AC啦!
俺减了两次枝
#include<bits/stdc++.h>
#define LL long long
#define ms(s) memset(s, 0, sizeof(s))
#define INF 0x7fffffff
using namespace std;
// 4 * 6
const int r = 4;
const int c = 6;
int maze[r * 2][c * 2];
// <- ↑ -> ↓
const int dx[] = {
0, -1, 0, 1};
const int dy[] = {
-1, 0, 1, 0};
const char w[] = {
'W', 'N', 'E', 'S'};
const int rev[] = {
2, 3, 0, 1};
vector<pair<int, int>> endVec;
int h(int x, int y) {
int minn = INF;
for(auto& pair: endVec) {
//cout << "pair.first: " << pair.first << " pair.second: " << pair.second << endl;
minn = min(abs(pair.first - x) + abs(pair.second - y), minn);
}
//cout << ">