把一部分无任何优化的 O(n3) bfs 题解卡T了。。。
https://www.luogu.com.cn/blog/_post/274594
https://www.luogu.com.cn/blog/_post/398057
https://www.luogu.com.cn/blog/_post/405839
https://www.luogu.com.cn/blog/_post/330359
https://www.luogu.com.cn/blog/_post/204915
gen:
#include<bits/stdc++.h>
using namespace std;
#define ri int
typedef long long ll;
const int maxn=1e5+10;
template<class T>inline bool ckmin(T &x,const T &y){return x>y?x=y,1:0;}
template<class T>inline bool ckmax(T &x,const T &y){return x<y?x=y,1:0;}
template<class T>inline void clear(T *arr,int siz,int val=0){memset(arr,val,sizeof(T)*(siz+1));}
int main(){
// freopen("input.txt","w",stdout);
ri n=1000,m=1000,k=1000;
printf("%d %d %d\n",n,m,k);
for(ri i=1;i<=n;++i,putchar(10))
for(ri j=1;j<=m;++j){
if(i==n-1&&j==m)putchar('#');
else if(i==n&&j==m-1)putchar('#');
else putchar('.');
}
printf("%d %d %d %d",1,1,n,m);
return 0;
}
输出为 -1。