CE求改
  • 板块题目总版
  • 楼主furina_1013
  • 当前回复5
  • 已保存回复5
  • 发布时间2024/8/7 15:38
  • 上次更新2024/8/7 16:24:45
查看原帖
CE求改
794188
furina_1013楼主2024/8/7 15:38

P1395 会议

#include<bits/stdc++.h>
using namespace std;
const int N=5*(1e4+1); 
int n;
int a,b; 
int arr[N][N];//链接图表
int vis[N] ;//判断是否被访问
int fu[N];//记录size
inline int DFS(int cnt)
{
	for(int i=1;i<=n;i++)
	{
		if(vis[cnt]==1)continue;
		if(arr[i][cnt])	
		{
			fu[cnt]=DFS(i);
			return fu[cnt];
		}
	}	
	fu[cnt]=1;
	return fu[cnt];
} 
int main()
{
/*	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);*/
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a>>b;
		arr[a][b]=1;
		arr[b][a]=1;
	}
	DFS(1);
	for(int i=1;i<=n;i++)cout<<fu[i];
	return 0;
}

//本地CE提示(部分) 207 C:\Users\Lenovo\AppData\Local\Temp\cc5bkrjh.s Error: value of 00000002542d77a6 too large for field of 4 bytes at 00000000000000e6

249 C:\Users\Lenovo\AppData\Local\Temp\cc5bkrjh.s Error: value of 0000000254308534 too large for field of 4 bytes at 0000000000000120

2024/8/7 15:38
加载中...