P1606 [USACO07FEB]荷叶塘Lilypad Pond 题目描述 FJ has installed a beautiful pond for his cows' aesthetic enjoyment and exercise. The rectangular pond has been partitioned into square cells of M rows and N columns (1 ≤ M ≤ 30; 1 ≤ N ≤ 30). Some of the cells h…
P1606 [USACO07FEB]荷叶塘Lilypad Pond 题目描述 FJ has installed a beautiful pond for his cows' aesthetic enjoyment and exercise. The rectangular pond has been partitioned into square cells of M rows and N columns (1 ≤ M ≤ 30; 1 ≤ N ≤ 30). Some of the cells h…
直接bfs,在过程中更新方案数即可 #include<iostream> #include<cstdio> #include<queue> using namespace std; const int N=55,inf=1e9,dx[]={1,1,-1,-1,2,2,-2,-2},dy[]={2,-2,2,-2,1,-1,1,-1}; int n,m,a[N][N],b[N][N],dis[N][N]; long long f[N][N]; bool v[N][N];…