Don't Get Rooked In chess, the rook is a piece that can move any number of squaresvertically or horizontally. In this problem we will consider smallchess boards (at most 44) that can also contain walls through whichrooks cannot move. The goal is to…
主题如以下: Don't Get Rooked In chess, the rook is a piece that can move any number of squaresvertically or horizontally. In this problem we will consider smallchess boards (at most 44) that can also contain walls through whichrooks cannot move. The goa…
把每个电梯口看作一个节点, 然后计算边的权值的时候处理一下, 就ok了. #include<cstdio> #include<vector> #include<queue> #include<cmath> #define REP(i, a, b) for(int i = (a); i < (b); i++) using namespace std; const int MAXN = 112; struct Edge { int v, id; }; st…