【HDU 2853】Assignment (KM)】的更多相关文章

Assignment Problem Description Last year a terrible earthquake attacked Sichuan province. About 300,000 PLA soldiers attended the rescue, also ALPCs. Our mission is to solve difficulty problems to optimization the assignment of troops. The assignment…
-->Nightmare Ⅱ 原题太复杂,直接简单的讲中文吧 Descriptions: X表示墙 .表示路 M,G表示两个人 Z表示鬼 M要去找G但是有两个鬼(Z)会阻碍他们,每一轮都是M和G先走M能走3步,G能走1步,Z每次向边上2步内变出分身.求所需最短时间. 鬼能穿墙,人不能 Sample Input 3 5 6 XXXXXX XZ..ZX XXXXXX M.G... ...... 5 6 XXXXXX XZZ..X XXXXXX M..... ..G... 10 10 ........…
Young naturalist Bill studies ants in school. His ants feed onplant-louses that live on apple trees. Each ant colony needsits own apple tree to feed itself.Bill has a map with coordinates of n ant colonies and napple trees. He knows that ants travel…
BUPT2017 wintertraining(15) #8F 题意 1到n的排列,经过几次置换(也是一个排列)回到原来的排列,就是循环了. 现在给n(<=1000),求循环周期的所有可能数. 题解 问题等价于几个正整数加起来等于n,求最小公倍数的可能数. 因为1不影响最小公倍数,所以等价于求几个正整数加起来小于等于n,最小公倍数的可能数. 最小公倍数与每个质因子在正整数里最大出现次数有关,所以枚举质因子的幂,进行dp. dp[i][j]表示前i个质数,和为j时,最小公倍数的可能数. dp[0]…
Problem Description Mr. Panda lives in Pandaland. There are many cities in Pandaland. Each city can be treated as a point on a 2D plane. Different cities are located in different locations. There are also M bidirectional roads connecting those cities…
Escape  Descriptions: 一个人从(0,0)跑到(n,m),只有k点能量,一秒消耗一点,在图中有k个炮塔,给出炮塔的射击方向c,射击间隔t,子弹速度v,坐标x,y问这个人能不能安全到达终点要求: 1.人不能到达炮塔所在的坐标2.炮塔会挡住子弹3.途中遇到子弹是安全的,但是人如果停在这个坐标,而子弹也刚好到这个坐标,人就被射死4.人可以选择停止不动 Input 对于每个测试用例,第一行有四个整数,m.n.k和d (2<=m, n<=100, 0<=k<=100, m…
Vacation 题意 有n+1辆车,属性有长度l,距离终点的距离s,速度v问你最末尾的车到达终点的时间 Sample Input 1 2 2 7 1 2 1 2 1 2 2 10 7 1 6 2 1 Sample Output 3.5000000000 5.0000000000 注意哈  Sample Input改一下格式 1 2 2 71 2 1 2 1 2 2 10 7 1 6 2 1 这样看的就舒服写了  我一开始做题,硬是看了数据好长时间,感觉这是故意这样写的,好坑啊 题目链接 htt…
题目给定n和d,都是10的9次方以内,求1到n里面有几个数最大因数是d?1000000组数据.解:求出d的满足p[i]*d<n的最小质因数是第几个质数.即为答案. #include<cstdio> #define N 100002 int t,n,d,pr[N],p[N],num; int main(){ for(int i=2;i<N;i++)if(!pr[i]){ for(int j=i+i;j<N;j+=i) pr[j]=1; p[++num]=i; } scanf(&…
题意是给你抢劫每个银行可获得的钱m和被抓的概率p,求被抓的概率小于P,最多能抢多少钱.01背包问题,体积是m,价值是p.被抓的概率不是简单相加,而应该是1−Π(1−p[i])DP:dp[i]表示抢到i元且不被抓的概率.初始条件:dp[0]=1:转移方程:dp[j]=max{dp[j],dp[j−m[i]]∗(1−p[i])}(j>=m[i]) #include<cstdio> #include<cstring> #include<algorithm> #defin…
Problem Description Mr.Panda is about to engage in his favourite activity doing laundry! He's brought L indistinguishable loads of laundry to his local laundromat, which has N washing machines and M dryers.The ith washing machine takes Wi minutes to…