Tour Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3408 Accepted: 1513 Description John Doe, a skilled pilot, enjoys traveling. While on vacation, he rents a small plane and starts visiting beautiful places. To save money, John must…
题面简述 一条线上等距地分布着 n n n 老鼠和 m m m 洞( m ≥ n m\geq n m≥n),这连续 n + m n+m n+m 个位置上要么是老鼠要么是洞,一个老鼠进一个洞,代价是所有老鼠的路程和,问最小代价. n + m ≤ 5000 n+m\leq 5000 n+m≤5000 题解 平方做法 每个老鼠匹配一个洞,我们可以发现存在最优方案,使得路径两两之间不包含,这样一来,从左到右老鼠匹配的洞位置就是单增的.可以用调整法证明,如果两条路径包含,那么把终点位置互换,如果路径方向不…
http://poj.org/problem?id=2175 Evacuation Plan Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3256 Accepted: 855 Special Judge Description The City has a number of municipal buildings and a number of fallout shelters that were build…