题目链接:https://vjudge.net/problem/HDU-4009 Transfer water Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 5612    Accepted Submission(s): 1997 Problem Description XiaoA lives in a village. Last ye…
Transfer water Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 3775    Accepted Submission(s): 1356 Problem Description XiaoA lives in a village. Last year flood rained the village. So they dec…
每一户人家水的来源有两种打井和从别家接水,每户人家都可能向外输送水. 打井和接水两种的付出代价都接边.设一个超级源点,每家每户打井的代价就是从该点(0)到该户人家(1~n)的边的权值.接水有两种可能,从高处接水,那么代价是哈密顿距离与Y的乘积(可以认为就是水管的费用):从低处接水,还要加上付出水泵的钱(水管+水泵的费用).这样就可以建图了.图论,会建图的话问题就解决一半了. 然后,用模版来解题.不过朱刘算法的模版时间复杂度的差异还是蛮大的.我的模版的建图是邻接矩阵,时间复杂度是O(N^3).超时…
Transfer water Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 6126    Accepted Submission(s): 2181 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4009 Description: XiaoA lives in a village. Las…
Transfer water Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 3995    Accepted Submission(s): 1438 Problem Description XiaoA lives in a village. Last year flood rained the village. So they deci…
Teen Girl Squad Description: You are part of a group of n teenage girls armed with cellphones. You have some news you want to tell everyone in the group. The problem is that no two of you are in the same room, and you must communicate using only cell…
Transfer water Time Limit:3000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4009 Description XiaoA lives in a village. Last year flood rained the village. So they decide to move the whole village to the moun…
Transfer water Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 4216    Accepted Submission(s): 1499 Problem Description XiaoA lives in a village. Last year flood rained the village. So they dec…
Command Network Time Limit: 1000MS   Memory Limit: 131072K Total Submissions: 20766   Accepted: 5920 题目链接:http://poj.org/problem?id=3164 Description: After a long lasting war on words, a war on arms finally breaks out between littleken’s and KnuthOce…
HDU - 4009:http://acm.hdu.edu.cn/showproblem.php?pid=4009 题意: 有n户人家住在山上,现在每户人家(x,y,z)都要解决供水的问题,他可以自己挖井,也可以从特定的别人那里调水.问所有人家都接上水后最小的花费. 思路: 据说是一道最小生成树的模版题,我觉得在建图上还是比较难的.每个人家从别人那里调水的关系是明确的,直接建图就行.那自己挖井,我们可以建立一个虚拟的源点,向每个点连一条边,边的权值就是挖井所要的费用.建完图后,就可以跑一遍最小树…