含[三点坐标计算面积].[判断两线段是否有交点].[求线段交点]模板   An Easy Problem?! Time Limit: 1000MS   Memory Limit: 65536K Total Submissions:15921   Accepted: 2459 Description It's raining outside. Farmer Johnson's bull Ben wants some rain to water his flowers. Ben nails two…
http://poj.org/problem?id=2826 题目大意:给两条线,让它接竖直下的雨,问其能装多少横截面积的雨. ———————————————————————————— 水题,看题目即可知道. 但是细节是真的多……不过好在两次AC应该没算被坑的很惨(全程没查题解). 推荐交之前看一下讨论版的数据,方便一次AC(我第一次就是作死直接交了结果我自己都想好的情况忘了写了……) 相信看到这篇题解的人都看过题了,那么先说细节: 1.C++提交(G++不知道为什么WA了……) 2.精度 3.…
呵呵哒.WA了无数次,一开始想的办法最终发现都有缺陷.首先需要知道: 1)线段不相交,一定面积为0 2)有一条线段与X轴平行,面积一定为0 3)线段相交,但是能接水的三角形上面线段把下面的线段完全覆盖. (1),(2)的情况简单,主要是解决(3).下面对(3)进行讨论,如下图所示,设p1,p2是两线段各自位置较高的点,p0为两线段的交点,向量e是三角形p0p1p2的关于边p1p2的外侧法向量.则当e的终点位于第1,2象限时才会有积水,3,4象限是没有的.判断e的方向可以根据它与(p0p1+p0p…
传送门 •题意 两根木块组成一个槽,给定两个木块的两个端点 雨水竖直下落,问槽里能装多少雨水, •思路 找不能收集到雨水的情况 我们令线段较高的点为s点,较低的点为e点 ①两条木块没有交点 ②平行或重合 ③至少有一条木块水平(雨水会滑落) ④形成覆盖,如"$\wedge $","人",还有比较难想的上边长下边短的情况 其中形成"$\wedge$"型和"人"型 都是两条线段的交点比两条线段中较低的s点同高,     也就是不大于…
Content 给定 \(n,m\),你需要输出一个长度为 \(n\) 的排列,满足该排列进行不超过 \(m\) 次交换操作可以得到的最小的字典序最大. 数据范围:\(T\) 组数据,\(1\leqslant T\leqslant 10^5\),\(1\leqslant n\leqslant 10^5\),\(\sum n\leqslant 10^5\),\(0\leqslant m\leqslant n\). Solution 算是一道比较小清新的构造题,接下来教你如何弄出正确的构造方案. 首…
http://poj.org/problem?id=2826 An Easy Problem?! Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10505   Accepted: 1584 Description It's raining outside. Farmer Johnson's bull Ben wants some rain to water his flowers. Ben nails two woode…
An Easy Problem?! Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12970   Accepted: 1995 Description It's raining outside. Farmer Johnson's bull Ben wants some rain to water his flowers. Ben nails two wooden boards on the wall of his bar…
An Easy Problem?! Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7837   Accepted: 1145 Description It's raining outside. Farmer Johnson's bull Ben wants some rain to water his flowers. Ben nails two wooden boards on the wall of his barn…
An easy problem Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5475 Description One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on the screen of calculator. At first,…
An Easy Problem   Description As we known, data stored in the computers is in binary form. The problem we discuss now is about the positive integers and its binary form. Given a positive integer I, you task is to find out an integer J, which is the m…