当前位置:网站首页>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
边栏推荐
- Cache character stream
- 基于BiLSTM的回归预测方法
- 两年独立开发经验程序员告诉我们赚钱的经验(听听真正赚到钱的高手做法)
- ES 节点2G内存分析
- 【黑马早报】尚乘数科上市13天,市值超阿里;北大终止陈春花聘用合同;新东方花近200亿退学费和遣散费;张小泉75%产品贴牌代工...
- Programmer Qixi Gift - How to quickly build an exclusive chat room for your girlfriend in 30 minutes
- 两个数组中用第二个数组的Value对比换第一个数组中的Key
- 244 page PDF!"2022 China cloud computing ecological blue book published
- 如何做好企业数字化转型?这10份靠谱案例收藏了(附下载)
- 分布式链路追踪Jaeger + 微服务Pig在Rainbond上的实践分享
猜你喜欢

Flutter使用 json_serializable 解析 JSON 最佳方案

小程序在政务服务平台建设中如何发挥价值

03 多线程与高并发 - ReentrantLock 源码解析

DC-DC电源中前馈电容的选择

十一、网络规划设计

ECCV 2022 | Towards Data Efficient Transformer Object Detectors

backbone核心详解系列——RepVGG

Programmer Qixi Gift - How to quickly build an exclusive chat room for your girlfriend in 30 minutes

1314元的七夕礼盒,收割了多少直男?

全面认识MOS管,一篇文章就够了
随机推荐
如何让 WPF 程序更好地适配 UI 自动化
Cool and efficient data visualization big screen, it's really not that difficult to do!丨Geek Planet
基于BiLSTM的回归预测方法
技术分享| 小程序实现音视频通话
Linux-Docker-Mysql安装
缓存字符流
systemdd-dev病毒杀
UMA & Hong Kong Polytechnic & Ali propose SP-ViT to learn 2D space prior knowledge for visual Transformer!
【PHP实现微信公众平台开发—基础篇】第1章 课程介绍
博云入选 Gartner 中国 DevOps 代表厂商
他是“中台”之父,凭一个概念为阿里狂赚百亿
“蔚来杯“2022牛客暑期多校训练营4 N
FHQ-Treap 简介
03 多线程与高并发 - ReentrantLock 源码解析
WPF---Grid布局讲解
A comprehensive understanding of MOS tubes, an article is enough
LeetCode每日一题(858. Mirror Reflection)
编辑器vscode Already included file name ‘xxx‘ differs from file name ‘xxx‘ only in casing报错
Nacos手摸手教学【二】Nacos注册中心
程序猿七夕礼物-如何30分钟给女友快速搭建专属语聊房