Area Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 225    Accepted Submission(s): 77 Problem Description 电子科大清水河校区是电子科大大力兴建的未来主校区,于07年秋正式迎接学生入住,目前有07.08级本科生及部分研究生在此校区学习.生活.清水河校区位于成都高新西区的中部地带,占…
You can Solve a Geometry Problem too Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13549    Accepted Submission(s): 6645 Problem Description Many geometry(几何)problems were designed in the ACM/…
2014-07-30 http://acm.hdu.edu.cn/showproblem.php?pid=2528解题思路: 求多边形被一条直线分成两部分的面积分别是多少.因为题目给的直线一定能把多边形分成两部分,所以就不用考虑多边形是否与直线相交.直接求问题. 将多边形的每一条边与直线判断是否相交.若相交,就从这点开始计算面积,直到判断到下一个边与直线相交的点.这之间的面积求出来为area2. area1为多边形的总面积.多边形被直线分成的另外一部分面积 = area1 - area2 有一个…
题目链接 线段树入门题,线段树单点更新求最大值问题. #include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #define N 200005 using namespace std; int data[N]; struct Tree { int l,r,ans; }tree[N*]; void build(int…
链接: http://poj.org/problem?id=1039 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#problem/B Pipe Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8350   Accepted: 2501 Description The GX Light Pipeline Company started to prep…
Mirror and Light Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 650    Accepted Submission(s): 316 Problem Description The light travels in a straight line and always goes in the minimal path b…
Problem ATriangle Fun Input: Standard Input Output: Standard Output In the picture below you can see a triangle ABC. Point D, E and F divides the sides BC, CA and AB into ratio 1:2 respectively. That is CD=2BD, AE=2CE and BF=2AF. A, D; B, E and C, F…
Pipe Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8280   Accepted: 2483 Description The GX Light Pipeline Company started to prepare bent pipes for the new transgalactic light pipeline. During the design phase of the new pipe shape th…
function CrossPoint( ) %% 求两条直线的交点坐标 x1 = [7.8 8]; y1 = [0.96 0.94]; %line2 x2 = [8.25 8.25]; y2 = [0 0.99]; %fit linear polynomial p1 = polyfit(x1,y1,1); p2 = polyfit(x2,y2,1); %calculate intersection x_intersect = fzero(@(x) polyval(p1-p2,x),3); y_…
一个简单的用叉积求任意多边形面积的题,并不难,但我却错了很多次,double的数据应该是要转化为long long,我转成了int...这里为了节省内存尽量不开数组,直接计算,我MLE了一发...,最后看了下别人的才过,我的代码就不发了,免得误导,不得不说几何真是... 还有就是这个大神的代码,貌似G++,过不了,C++AC #include <iostream> #include <algorithm> #include <cstdio> #include <c…