http://acm.hdu.edu.cn/showproblem.php? pid=4123 Problem Description Bob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N - 1 roads in his village. Each road connects two houses,…
Largest Rectangle in a Histogram 这么经典的题硬是等今天碰到了原题现场懵逼两小时才会去补题...废话不多说: 题意:截取一个矩形使其面积最大,随你怎么截,反正面积要最大.输出最大面积,注意爆int. 思路:dp或单调队列.核心思路是从一个小矩形往两边扩散,分别找两边第一个小于这个矩形的位置,其中面积就是这个小矩形与区间长度的乘积,我们预处理出所有的小矩形的这两个端点值,然后扫一遍即可更新到最…
题目: Bob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N - 1 roads in his village. Each road connects two houses, and all houses are connected together. To make the race more in…
题目链接 Problem Description Bob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N - 1 roads in his village. Each road connects two houses, and all houses are connected together. To…
One hundred layer Problem Description Now there is a game called the new man down 100th floor. The rules of this game is: 1. At first you are at the 1st floor. And the floor moves up. Of course you can choose which part you will stay in the first…
Bob’s Race Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 378 Accepted: 119 Description Bob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N - 1 roads in his vil…