有哪位大神在吗?请看一下
查看原帖
有哪位大神在吗?请看一下
427045
cwxcplh楼主2023/5/21 11:33

因为本蒟蒻

不会

强连通分量,缩点(???)

所以

我打了个模拟

但是!!!

(没有但是的话我就不会来这里了)

我发现,这个代码没办法运算往返图(就是两个点可以往返)

于是

我来到了这里

#include<bits/stdc++.h>
using namespace std;
int n,m,x,y,ans,bb[100006];
int main()
{
	int i;
	cin>>n>>m;
	while(m--)
	{
		cin>>x>>y;
		bb[y]=x;
	}
	for(i=1;i<=n;i++)
	{
		if(bb[i]==0)
		{
			ans++;
		}
	}
	if(ans==0)
	{
		ans=1;
	}
	cout<<ans;
	return 0;
}
2023/5/21 11:33
加载中...