t记录每个格子最早被砸的时间,bfs(x,y,t)表示当前状态为(x,y)格子,时间为t.因为bfs,所以先搜到的t一定小于后搜到的,所以一个格子搜一次就行 #include<iostream> #include<cstdio> #include<queue> using namespace std; const int N=505,inf=1e9,dx[]={-1,1,0,0,0},dy[]={0,0,-1,1,0}; int n,m,t[N][N]; bool v[…
Description Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a safe location (one that is never destroy…
Description Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a safe location (one that is never destroy…
Description Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a safe location (one that is never destroy…
求LIS , 然后用 n 减去即为answer ---------------------------------------------------------------------------- #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #define rep( i , n ) for( int i = 0 ; i < n ; ++i…
直接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];…