当前位置:网站首页>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.
代码:
边栏推荐
- Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer 论文笔记
- Guo Jingjing's personal chess teaching, the good guy is a robot
- 商汤自研机械臂,首款产品是AI下棋机器人:还请郭晶晶作代言
- Keithley DMM7510精准测量超低功耗设备各种运作模式功耗
- 「企业架构」应用架构概述
- Hackbar 使用教程
- Open Office XML 格式里如何描述多段具有不同字体设置的段落
- 22家!北京昌平区通报存在食品安全问题餐饮服务企业
- How to do foreign media publicity to grasp the key points
- “68道 Redis+168道 MySQL”精品面试题(带解析)
猜你喜欢

来看Prada大秀吗?在元宇宙里那种!

bgp dual plane experiment routing strategy to control traffic

Chapter9 : De Novo Molecular Design with Chemical Language Models

LeetCode·每日一题·640.求解方程·模拟构造

在web页面播放rtsp流视频(webrtc)

AICOCO AI Frontier Promotion (8.10)

2022 Recruitment Notice for Academician Zhao Guoping Group of Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences

11 + chrome advanced debugging skills, learn to direct efficiency increases by 666%

Keithley DMM7510精准测量超低功耗设备各种运作模式功耗

Solution for "Certificate not valid for requested usage" after Digicert EV certificate signing
随机推荐
Jiugongge lottery animation
跨域的五种解决方案
Twikoo腾讯云函数部署转移到私有部署
mSystems | 中农汪杰组揭示影响土壤“塑料际”微生物群落的机制
【iOS】面试整理
OTA自动化测试解决方案---整体方案介绍
机器学习实战(2)——端到端的机器学习项目
【百度统计】用户行为分析
ArcMAP出现-15的问题无法访问[Provide your license server administrator with the following information:Err-15]
mSystems | Zhongnong Wang Jie Group Reveals the Mechanisms Affecting Soil "Plastic Interstitial" Microbial Communities
讯飞创意组别 全国选拔赛成绩公布说明
娄底石油化工实验设计、建设规划概述
浙大、阿里提出DictBERT,字典描述知识增强的预训练语言模型
【mysql索引实现原理】
odps sql 不支持 unsupported feature CREATE TEMPORARY
IP地址分类以及网络地址的计算(子网划分、超网划分)[通俗易懂]
表中存在多个索引问题? - 聚集索引,回表,覆盖索引
A detailed explanation of implementation api embed
H264 GOP 扫盲
娄底疾控中心实验室设计理念说明