HDU 4309 Contest 1】的更多相关文章

最大流建图.开始以为旧桥有1000座,没敢用枚举,后来看看题目发现了只是十二座.枚举桥的状态没问题. 对于隧道的容量W,可以虚拟出第三个结点表示,如u->v.增加一个点p,u->p(INF),p->v(INF),p->End(W); #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; con…
Seikimatsu Occult Tonneru Time Limit: 6000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ID: 430964-bit integer IO format: %I64d      Java class name: Main   During the world war, to avoid the upcoming Carpet-bombing from The T…
http://acm.hdu.edu.cn/showproblem.php?pid=4309 题意: 有n个城市,每个城市有num[i]个居民,有敌人要进行地毯式轰击,居民们要逃到隧道去.现在有隧道,隧道允许无限个人通过,并且可以容纳w个人:有桥,可以允许无限个人通过,但是不能容纳人:还有一些破桥,修复这些破桥需要w花费,如果不修复,那么最多只能通过一人,如果修复了,那么可以通过无限个人.求出在能安全到达隧道的最大人数时的最小代价.(上述都是单向边) 思路:出题人也是有心了..在题目中有说破桥的…
Problem Description In the ACM International Collegiate Programming Contest, each team consist of three students. And the teams are given 5 hours to solve between 8 and 12 programming problems.  On Mars, there is programming contest, too. Each team c…
意甲冠军:N个人M通过主打歌有自己的期望,每个问题发送人玩.它不能超过随机播放的次数1,追求最大业绩预期 (1 ≤ N ≤ 10,1 ≤ M ≤ 1000). 主题链接:pid=5045" target="_blank">http://acm.hdu.edu.cn/showproblem.php?pid=5045 -->>设dp[i][j]表示已出战了前i - 1道题目,已出战的人的状态序列为j,如今要做第i道题目的最大期望.则最后要求的结果为max{dp[…
Contest Problem Description In the ACM International Collegiate Programming Contest, each team consist of three students. And the teams are given 5 hours to solve between 8 and 12 programming problems. On Mars, there is programming contest, too. Each…
Coding Contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2653    Accepted Submission(s): 579 Problem Description A coding contest will be held in this university, in a huge playground. The…
主题链接:点击打开链接 意甲冠军: 题意:给出一张N(N<=100)个点,M(M<=1000条)边的有向图. 每一个点上都有一些人.每条边有4个属性(u,v,w,p). 这些边分为三种:(1)p<0时.表示这条边是隧道,这条隧道从u连向v,尽管假设想通过这条隧道的话没有流量限制.但可以最多仅仅容纳w人;(2)p=0时,这条边是道路.由u连向v,通过没有流量限制;(3)p>0时.表示这条边是古老的桥.u连向v.假设不修这座桥,则仅仅能通过1人.可是假设花费w的费用修桥的话,则通过这座…
题解:我们使用一个二位数组dp[i][j]记录进行到第i个任务时,人组合为j时的最大和(这里的j我们用二进制的每位相应一个人). 详细见代码: #include <iostream> #include <cstdio> #include <cstring> #include <cmath> using namespace std; typedef long long ll; double s[11][1010]; double dp[1010][1050];…
pid=5045">主题链接~~> 做题感悟:比赛时这题后来才写的,有点小尴尬.两个人商议着写写了非常久才写出来,I want to Powerful ,I believe me . 解题思路: 遗憾 ! 感觉领悟能力太低 .由于随意时刻随意两个人做的题不超过 1 题 ,so~>  必须是一轮一轮的来(n 道题一轮),每一个人在一轮中仅仅能做一题.假设多做一题就,有可能某个人没选,某个人选择了两道,这样就不符合规定了 . 用 1  代表选择.0  代表没选择.进行某一行的时候就…