HDU-2448 Mining Station on the Sea】的更多相关文章

Mining Station on the Sea Problem Description The ocean is a treasure house of resources and the development of human society comes to depend more and more on it. In order to develop and utilize marine resources, it is necessary to build mining stati…
Mining Station on the Sea Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3565    Accepted Submission(s): 1108 Problem Description The ocean is a treasure house of resources and the development…
Mining Station on the Sea Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2584    Accepted Submission(s): 780 Problem Description The ocean is a treasure house of resources and the development…
先根据不同的起点跑最短路,记录距离,从而建立二分图求最小匹配. 一开始我求最短路的时候我把港口直接加到图中,然后发现进了港口就不能出来了,所以连接港口的边就要从双向边改成单向边…………这也搞得我n和m分不清了…… 还不如排除掉港口算最短路后再统计各艘船到各个港口的最短距离…… 然后我还傻叉地用了Dijkstra来求最短路,当然TLE咯…… 事实证明,Floyd就可以了嘛我智商跑哪里去了... #include <cstdlib> #include <cstdio> #include…
Mining Station on the Sea Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2997    Accepted Submission(s): 913 Problem Description The ocean is a treasure house of resources and the development o…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3879 A famous mobile communication company is planning to build a new set of base stations. According to the previous investigation, n places are chosen as the possible new locations to build those new s…
Base Station Time Limit: 2000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ID: 3879 64-bit integer IO format: %I64d      Java class name: Main A famous mobile communication company is planning to build a new set of base statio…
今天hdu的比赛的第一题,凸包+区间dp. 给出n个点m个圆,n<400,m<100,要求找出凸包然后给凸包上的点连线,连线的两个点不能(在凸包上)相邻,连线不能与圆相交或相切,连线不能相交但是可以有公共端点. 首先找出凸包,然后把n*n条边和m个圆算点到直线距离验证一下边是否与圆相交存到e[n][n]里. 然后显然是一个dp,但是我开始看错题目了以为不能有公共端点,能有公共端点的情况考虑一下像一个找三角形的过程,就是区间dp. 区间dp有一点妙的地方是最大区间范围是凸包点数而不用+1,因为连…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6603 题目大意:给出一个凸包,凸包内有若干个圆,要求画尽可能多的对角线使得他们两两不在凸包内相交且不与任意一个圆有公共点 题解:先预处理出所有点对间的连线是否会和圆有公共点,记为x[i][j],之后进行区间DP.设f[i][d]表示从第\(i\)个点到\(i+d\)个点这个区间之内最多能画多少条对角线,那么就有\(f[i][d]=x[i][nxt]+max(f[i][d-1],f[i+1][d-1]…
经典例题,好像说可以转化成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). 对原本的…