https://www.luogu.com.cn/problem/P2419 真的妙蛙。巧妙应用位运算和floyed算法 首先:只有 一头牛和其他所一路牛的关系确定了,它的排名才确定。 而floyed算法,不仅能确定任意两点的小小路径,此处竟然和位运算结合,表示两点之间时候有关联(能否走到)
#include
using namespace std;
const int maxn=1e2+5;
const int inf=0x3f3f3f3f;
int n,m,f[maxn][maxn],ans,g;
int main()
{
scanf("%d%d",&n,&m);
for(int i=1;i
关注
打赏