P1763 friendly group

教授Alex计划组织学生参加学术会议,团队中每对朋友都可能增加或减少友爱值。目标是找出能实现的最大友爱值。输入包含学生数量和朋友对的数量,以及朋友对的配对信息。输出为每个测试案例的最大友爱值。
摘要由CSDN通过智能技术生成

题目描述

Professor Alex will organize students to attend an academic conference.

Alex 教授将要组织学生参加学术会议。

Alex has n excellent students, and he decides to select some of them (possibly none) to attend the conference. They form a group. Some pairs of them are friends.

Alex 有 n 个很好的的学生,他决定选一些(也可能不选)让他们去开会,他们组成了一个小组,有些学生两两是朋友。

The friendly value of the group is initially 0. For each couple of friends (x,y), if both of them attend the conference, the friendly value of the group will increase 1, and if only one of them attends the conference, the friendly value of the group will decrease 1. If k students attend the conference, the friendly value of the group will decrease k.

小组的 “友爱值” 初始是 0,对于每一对好朋友 (x,y),如果他们都参加会议了,“友爱值” 就会增加 1,如果一对好朋友只有一个人去参加会议,友爱值就会减少 1。如果有 k 个学生参加了会议,友爱值会减少 k 。

Alex wants to make the group more friendly. Please output the maximum friendly value

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值