Codeforces 311.E Biologist】的更多相关文章

E. Biologist time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output SmallR is a biologist. Her latest research finding is how to change the sex of dogs. In other words, she can change female do…
题目传送门 题意:现在有n座山峰,现在 i-1 与 i 座山峰有 di长的路,现在有m个宠物, 分别在hi座山峰,第ti秒之后可以被带走,现在有p个人,每个人会从1号山峰走到n号山峰,速度1m/s.现在你可以安排好这p个人的出发时间,问所有宠物的等待时间是多少. 题解: 斜率优化DP 我们知道一个人出发之后,该宠物的等待时间就已经决定了. 所以我们可以把每个宠物的0等待时间算出来, 即 A[i] = t[i] - d[h[i]], d为1-h[i]的距离 然后把A[i]排序之后,就可以得到一个出…
网络流/最大权闭合图 题目:http://codeforces.com/problemset/problem/311/E 嗯这是最大权闭合图中很棒的一道题了- 能够1A真是开心-也是我A掉的第一道E题吧……(其实是这题放在E偏水了吧……) 题目大意:有n个0/1变量,给定每个变量的初值,以及每个变量取反的费用$v_i$,有m组需求,对于第 i 组需求,如果集合$S_i$里面的每个变量的值都为给定的v(0 or 1),则获得$\omega_i$的利润,求最大总利润.(其中某些请求若是无法满足还需额…
E. Ann and Half-Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/E Description Tomorrow Ann takes the hardest exam of programming where she should get an excellent mark. On the last theoretical class t…
D. Vitaly and Cycle Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/D Description After Vitaly was expelled from the university, he became interested in the graph theory. Vitaly especially liked the cycles of an…
C. Arthur and Table Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/C Description Arthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is unstable. In t…
B. Pasha and Tea Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/B Description Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and…
A. Ilya and Diplomas Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/A Description Soon a school Olympiad in Informatics will be held in Berland, n schoolchildren will participate there. At a meeting of the jury…
E. Ann and Half-Palindrome time limit per test 1.5 seconds memory limit per test 512 megabytes input standard input output standard output Tomorrow Ann takes the hardest exam of programming where she should get an excellent mark. On the last theoreti…
Discription SmallR is a biologist. Her latest research finding is how to change the sex of dogs. In other words, she can change female dogs into male dogs and vice versa. She is going to demonstrate this technique. Now SmallR has n dogs, the costs of…