题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5855 Less Time, More profit Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others) 问题描述 The city planners plan to build N plants in the city which has M shops. Each shop needs p…
The city planners plan to build N plants in the city which has M shops. Each shop needs products from some plants to make profit of proiproi units. Building ith plant needs investment of payipayi units and it takes titi days. Two or more plants can b…
题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=5855 Description The city planners plan to build N plants in the city which has M shops. Each shop needs products from some plants to make profit of proi units. Building ith plant needs investment o…
传送门 好题啊. ∑i<jpi,jK∗(200−K)>X\frac{\sum_{i<j}p_{i,j}}{K*(200-K)}>XK∗(200−K)∑i<j​pi,j​​>X =>∑i<jpi,j−XK(200−K)>0\sum_{i<j}p_{i,j}-XK(200-K)>0∑i<j​pi,j​−XK(200−K)>0 =>∑i<jpi,j+2XK∗K2−XK(199−K)>0\sum_{i<j}p_{…
题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=4971 Description There's a company with several projects to be done. Finish a project will get you profits. However, there are some technical problems for some specific projects. To solve the proble…
裁员 [问题描述] 在一个公司里,老板发现,手下的员工很多都不务正业,真正干事员工的没几个,于是老板决定大裁员,每开除一个人,同时要将其下属一并开除,如果该下属还有下属,照斩不误.给出每个人的贡献值和从属关系,求在最大贡献值的前提下最小剩下多少人及最大贡献值.留下多少人无所谓,现在老板想知道留下的人最大的贡献值是多少. [输入描述] 第一行两个整数n,m,表示有多少个员工与多少个从属关系. 第二行n个整数,表示每个员工的贡献值. 接着m行,每行两个数x,y,表示x是y的下属,一个员工可能有多个下…
Firing Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 11558 Accepted: 3494 Description You've finally got mad at "the world's most stupid" employees of yours and decided to do some firings. You're now simply too mad to give response…
题目链接:http://poj.org/problem?id=2987 Time Limit: 5000MS Memory Limit: 131072K Description You’ve finally got mad at “the world’s most stupid” employees of yours and decided to do some firings. You’re now simply too mad to give response to questions li…
题目 Source http://www.lydsy.com/JudgeOnline/problem.php?id=1565 Description Input Output 仅包含一个整数,表示可以获得的最大能源收入.注意,你也可以选择不进行任何攻击,这样能源收入为0. Sample Input 3 2 10 0 20 0 -10 0 -5 1 0 0 100 1 2 1 100 0 Sample Output 25 分析 题目大概说n*m的格子上有植物,僵尸从某行最右边开始进攻,消除各个植物…
经典例题,好像说可以转化成maxflow(n,n+m),暂时只可以勉强理解maxflow(n+m,n+m)的做法. 题意:输入n个点,m条边的无向图.点权为负,边权为正,点权为代价,边权为获益,输出最大获益. (最大权闭合子图:图中各点的后继必然也在图中) 构图攻略:将边看做点, 若选某条边e[i](u,v,w),则必须选点u,v.由此构成一个有向图.也符合最大权闭合子图模型. 对原本的边e[i](u,v,w)连3条边(S,n+i,w),(n+i,u,inf),(n+i,v,inf). 对原本的…