摘要: 模板题,注意一下输出就可以。#include #include #include #include using namespace std;struct point { double x,y;};struct triangle{ point t[3];}t;struct Circle{ double... 阅读全文
posted @ 2014-07-30 11:32 chenjunjie1994 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 水题,就是把一个矩形平分。题意:一个wid*hei的矩形,过底边上的一点(dor,0)做m-1条射线,把这个矩形的面积平均分成m份,求这些射线和矩形的另外一个交点。直接枚举,然而求三角形高底移动坐标即可。#include #include #include #include using namesp... 阅读全文
posted @ 2014-07-30 10:32 chenjunjie1994 阅读(139) 评论(0) 推荐(0) 编辑
摘要: PICK定理:格子上的多边形面积=边界上格子点数/2+内部点数-1。利用叉积求出面积。再枚举边上的点数。然后按公式求出内部点数就可以了。关于PICK:http://blog.csdn.net/i_fuqiang/article/details/9817343#include #include #in... 阅读全文
posted @ 2014-07-29 22:22 chenjunjie1994 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 先判断是否在圆内,然后用叉积判断是否在180度内。枚举判断就可以了。。。感觉是数据弱了。。#include #include #include #include #include using namespace std;const double eps=0.00000001;struct point... 阅读全文
posted @ 2014-07-29 21:16 chenjunjie1994 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 题意:从一条线段(property)上观察另一与之平行的线段(house),其中有很多与它们都平行的线段(障碍物),求在property得可见整条线段house的最长连续范围的长度。初时的想法是,求出在哪些点的范围可以看到整个HOUSE。 后来在DIS上找了几组数据,就变得都要特判了。再想想,既然找... 阅读全文
posted @ 2014-07-29 20:33 chenjunjie1994 阅读(341) 评论(0) 推荐(0) 编辑
摘要: 可以证明O是三角形ABC的垂心。作图辅助线,一个很重要的技巧是延长中线等中线。可以证明三角形DNA全等于ABC。然后通过角度变换容易证明AQ垂直于BC。#include #include #include using namespace std;struct point{ double x,y;}A... 阅读全文
posted @ 2014-07-29 15:22 chenjunjie1994 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 可以通过顶角角度来计算切线与坐标轴的坐标开始还以为有公式可以算,谁知道原来是解二元一次方程,靠。。#include #include #include #include using namespace std;const int MAX=1050;struct point{ double x; in... 阅读全文
posted @ 2014-07-28 22:27 chenjunjie1994 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 不知 是怎么看出的精度不够,吸经验吧。#include #include #include #include #include using namespace std;char str[1000050];int dir[10][2]={{0,0},{-1,-1},{0,-1},{1,-1},{-1,... 阅读全文
posted @ 2014-07-28 20:50 chenjunjie1994 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 一条直线,必定可以通过旋转和平移使得它和一个上顶点一下顶点相切,这样的直线是最优的。因为这样能确定了直线所能到达的最远X。这样的两个顶点就规定了它的上下界,所以,枚举上下顶点,注意判断是否能到达入口处。只需判断直线是否与每个横切面的直线都有相交。#include #include #include ... 阅读全文
posted @ 2014-07-28 11:53 chenjunjie1994 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 由于到达点时不能绕墙,因为这是无意义的,所以,两点间的最小墙依然是按照直线所穿过的墙计算。#include #include #include #include using namespace std;const double eps=0.000000001;struct point{ double... 阅读全文
posted @ 2014-07-28 11:49 chenjunjie1994 阅读(160) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/metaphysis/article/details/6926997先向作者表达一下敬佩吧,十分巧妙地利用了状态压缩。这道题有点组合数学的味道,当一个格子选后,就把行最大值与格子值相等的行标志位置1.这样,当111111111111即是求的状态了。这样,可以... 阅读全文
posted @ 2014-07-27 11:24 chenjunjie1994 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 内部也是相交#include #include #include #include using namespace std;struct point{ int x,y;};struct edge{ point start,end;}line[4],the;void swaped(int &x,int... 阅读全文
posted @ 2014-07-26 11:03 chenjunjie1994 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 开一个数组做成队列来搜索就好了。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 const int MAXN=100010; 9 10 typedef struct po... 阅读全文
posted @ 2014-07-25 21:55 chenjunjie1994 阅读(201) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std;const int Max=1050;struct e{ int x1,x2;}edge[Max];struct c{ int x,y;}cal[4];int n,m;int X1,Y1,... 阅读全文
posted @ 2014-07-25 16:10 chenjunjie1994 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 枚举每两点的直线,看连线中是否存在线段交点,若存在,即这两点的直线不存在。建图,DIJK就可以了。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 cons... 阅读全文
posted @ 2014-07-24 22:30 chenjunjie1994 阅读(207) 评论(0) 推荐(0) 编辑