当前位置:网站首页>Motion Regulations (18) - and check the basic questions - gang
Motion Regulations (18) - and check the basic questions - gang
2022-08-04 12:33:00 【H_Cisco】
lives in a cityNPersonally, any two people who know each other are either friends or enemies, and are satisfied:
1, My friend's friend is my friend;
2, The enemy of my enemy is my friend;
All people who are friends form a gang.Tell you about thisNpersonalM pieces of information, that is, two people are friends, or two people are enemies, please write a program to calculate the city with the mostHow many gangs might there be?
Enter
The first line contains an integerN, the second line contains an integerM
NextMLine DescriptionM pieces of information, the content is one of the following two: "0 X Y" means XandYis a friend;"1 X Y" means X and Y is the enemy.
Output
Contains an integer, the maximum possible number of gangs.
Sample input
6 4
1 1 4
0 3 5
0 4 6
1 1 2
Sample output
3
边栏推荐
猜你喜欢
【全网首发】Redis系列5:深入分析Cluster 集群模式
直击面试!阿里金九银十最新面试小册 稳过!
#夏日挑战赛#OpenHarmony 给你的输入法加点彩—星球崛起
Linux-Docker-Mysql安装
集群监控——Zabbix
来 TDengine 开发者大会,洞悉数据技术发展的未来趋势
Practical sharing of distributed link tracking Jaeger + microservice Pig on Rainbond
Motion Rule (16)-Union Check Basic Questions-Grid Game
罗振宇的A股梦,咋这么难圆?
DC-DC电源中前馈电容的选择
随机推荐
C#控制台退出前操作
【黑马早报】尚乘数科上市13天,市值超阿里;北大终止陈春花聘用合同;新东方花近200亿退学费和遣散费;张小泉75%产品贴牌代工...
独立站卖家如何使用 WhatsApp Business API 建立有意义的客户关系?
244 page PDF!"2022 China cloud computing ecological blue book published
用VbScript控制光驱
获取本机IP地址的脚本
Hit the interview!The latest interview booklet of Ali Jin, nine silver and ten is stable!
【全网首发】Redis系列5:深入分析Cluster 集群模式
《独行月球》猛药,治不了开心麻花内耗
Django框架MySQL数据库到models模型的映射关系
正则表达式
DC/DC电感底部要不要覆铜?
OAuth2图文快速入门
matlab串口读写
论文翻译:2022_Time-Frequency Attention for Monaural Speech Enhancement
抗积分饱和PID控制器
num_workers
【微信小程序】信息管理与信息系统专业社会实习制作项目--垃圾指纹
炫酷又高效的数据可视化大屏,做起来真的没那么难!丨极客星球
第10章 模块和包