当前位置:网站首页>Network Saboteur
Network Saboteur
2022-08-10 13:18:00 【51CTO】
Problem Description
A university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks in order to minimize traffic between parts.
A disgruntled computer science student Vasya, after being expelled from the university, decided to have his revenge. He hacked into the university network and decided to reassign computers to maximize the traffic between two subnetworks.
Unfortunately, he found that calculating such worst subdivision is one of those problems he, being a student, failed to solve. So he asks you, a more successful CS student, to help him.
The traffic data are given in the form of matrix C, where Cij is the amount of data sent between ith and jth nodes (Cij = Cji, Cii = 0). The goal is to divide the network nodes into the two disjointed subsets A and B so as to maximize the sum ∑Cij (i∈A,j∈B).
Input
The first line of input contains a number of nodes N (2 <= N <= 20). The following N lines, containing N space-separated integers each, represent the traffic matrix C (0 <= Cij <= 10000). <br>Output file must contain a single integer -- the maximum traffic between the subnetworks. <br>
Output
Output must contain a single integer -- the maximum traffic between the subnetworks.
Sample Input
Sample Output
Many points are directly distant,Divide the points into two-sum sets,The division method of the largest of the two sets.
思路:
用dfs()Repeatedly divide the points into two sets.
代码:
边栏推荐
- 讯飞创意组别 全国选拔赛成绩公布说明
- 【论文+代码】PEBAL/Pixel-wise Energy-biased Abstention Learning for Anomaly Segmentation on Complex Urban Driving Scenes(复杂城市驾驶场景异常分割的像素级能量偏置弃权学习)
- 11 + chrome advanced debugging skills, learn to direct efficiency increases by 666%
- shell:常用小工具(sort、uniq、tr、cut)
- LeetCode·每日一题·640.求解方程·模拟构造
- BEVDet4D: Exploit Temporal Cues in Multi-camera 3D Object Detection 论文笔记
- 娄底妆品实验室建设规划构思
- Ethernet channel Ethernet channel
- 多线程下自旋锁设计基本思想
- Codeforces Round #276 (Div. 1) B. Maximum Value
猜你喜欢
随机推荐
在web页面播放rtsp流视频(webrtc)
CodeForces - 834C
Codeforces Round #276 (Div. 1) D. Kindergarten
Ethernet channel Ethernet channel
海外邮件发送指南(二)
Have you guys encountered this problem?MySQL 2.2 and 2.3-SNAPSHOT are like this, it seems to be
Guidelines for Sending Overseas Mail (2)
Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer Paper Notes
十八、一起学习Lua 调试(Debug)
mSystems | 中农汪杰组揭示影响土壤“塑料际”微生物群落的机制
M²BEV: Multi-Camera Joint 3D Detection and Segmentation with Unified Bird’s-Eye View Representation
10 款更先进的开源命令行工具
Proprietary cloud ABC Stack, the real strength!
九宫格抽奖动效
ArcMAP has a problem of -15 and cannot be accessed [Provide your license server administrator with the following information:Err-15]
娄底疾控中心实验室设计理念说明
I would like to ask the big guys, how to solve this error when cdc oracle initializes a 3 million table task running
“68道 Redis+168道 MySQL”精品面试题(带解析)
讯飞创意组别 全国选拔赛成绩公布说明
phpstrom 快速注释: