上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 17 下一页
摘要: 比较水的题,但是要细心,把情况考虑清楚#include <cstdio> #include <algorithm> #include <cmath> using namespace std; const int maxn=10000; const double eps=1e-8; int n,f[maxn]; double rad; struct Point { double x,y; }; Point ver[maxn],pel; double cross(Point a,Point b,Point c,Point d) { return (b.x-a.x 阅读全文
posted @ 2013-03-10 15:13 LJ_COME!!!!! 阅读(129) 评论(0) 推荐(0)
摘要: 复习了下线段树线段树的区间修改这道题有调试了两个多小时,怎么没进步啊,wa的原因是两个int形相乘,结果如果是long形,不仅结果的变量要用long,这两个数也得是long形,不然仍会溢出,原来就犯过同样的错误,怎么又犯了,还有找了那么长时间,k靠!!!!!!!!!!!!还有还有,如果要组成if else 语句,要有括号就都有,不能只有一个有#include <iostream> #include <cstdio> #include <algorithm> #define LL __int64 using namespace std; int n,tot; 阅读全文
posted @ 2013-03-09 18:59 LJ_COME!!!!! 阅读(175) 评论(0) 推荐(0)
摘要: 计算几何凸包,理解的不是很透彻,还是为什么要用凸包而不是一般的凸多边形这一问题,代码的准确率还是很低,以后要仔细仔细再仔细#include <iostream>#include <stdio.h>#include <algorithm>using namespace std;const int maxn=1000+10;struct Point{ int x,y;};Point po[maxn];int vis[maxn];int n;int cou[maxn];int ch[maxn];int cross(Point a,Point b,Point c,P 阅读全文
posted @ 2013-03-08 21:57 LJ_COME!!!!! 阅读(120) 评论(0) 推荐(0)
摘要: 直线的交点,题目不是很难,但还是太粗心,其中有一步疏忽,导致无限wa,最后还是发现了#include <iostream> #include <stdio.h> #include <algorithm> using namespace std; const int maxn=10000; double eps=1e-10; struct node { double x1,x2,y; }; struct Point { double x,y; Point(double x=0,double y=0):x(x),y(y) {}; }; node arc[maxn 阅读全文
posted @ 2013-03-07 18:48 LJ_COME!!!!! 阅读(126) 评论(0) 推荐(0)
摘要: 凸包至今还不知道这道题为什么凸包就是解,在网上搜结题报告也都是说求凸包,没告诉深层原因,求大神解答#include <iostream> #include <cstdio> #include <algorithm> #include <math.h> using namespace std; const int maxn=1000+10; struct node { int x,y; }; node point[maxn]; int ch[maxn]; int n,l; bool cmp(node a,node b) { if(a.x<b. 阅读全文
posted @ 2013-03-05 21:07 LJ_COME!!!!! 阅读(134) 评论(0) 推荐(0)
摘要: 哎~~~~~~~~~~~~#include <iostream> #include <stdio.h> #include <math.h> using namespace std; const int maxn=25*2; const double eps=1e-8; struct Point { double x,y; }; int n; double maxv; Point up[maxn],bottom[maxn]; struct Line{ double a, b, c; }; double cross(Point a,Point b,Point c 阅读全文
posted @ 2013-03-05 16:35 LJ_COME!!!!! 阅读(129) 评论(0) 推荐(0)
摘要: 贪心+计算几何(叉点积)个人认为本体用贪心解释最合理,我就是用贪心思考的此题代码些的太挫啦#include <iostream>#include <stdio.h>#include <stack>#include <math.h>#include <string.h> using namespace std;const int maxn=55;int m,n;int vis[maxn];int path[maxn];struct Point{ int x,y; Point(int x=0,int y=0):x(x),y(y) { }} 阅读全文
posted @ 2013-03-04 19:31 LJ_COME!!!!! 阅读(123) 评论(0) 推荐(0)
摘要: 题目不难,就是线段相交判断。叉积和点积的应用,但是却需要细心,看清题意#include <iostream>#include <stdio.h>using namespace std;int cross(int x1,int y1,int x2,int y2){ return x1*y2-y1*x2;}int dot(int x1,int y1,int x2,int y2){ return x1*x2+y1*y2;}int ons(int x1,int y1,int x2,int y2,int x3,int y3){ if(cross(x3-x1,y3-y1,x3-x2 阅读全文
posted @ 2013-03-03 15:22 LJ_COME!!!!! 阅读(154) 评论(0) 推荐(0)
摘要: 这道题学会的就是从结果想问题,找到应该考虑的方向如果存在一直线l,使所有线段在l上的投影有交点,考虑只有一个交点这个极限,过此交点m做l的垂线,所有线段上的那个在l上的投影是m的点肯定过此垂线,所以存在直线l的必要条件就是至少存在一条直线交所有的线段,然后很显然至少存在一条直线交所有的线段是存在直线l的充分条件,所以原问题就转化为了是否有一条直线交所有的线段,而这一问题,可转换为是否存在过某两条线段的某两个不重合的端点的直线,交所有的线段。但太粗心了,这道题经该了4个小时,才把所有错误改完啦,ai~~~~~~~~~~~#include <iostream> #include < 阅读全文
posted @ 2013-03-02 16:04 LJ_COME!!!!! 阅读(154) 评论(0) 推荐(0)
摘要: 这道题目思维+基础,好题目拓扑排序以后看到sij就要想到连续和转化为前缀和之差的思想,通过表格得到两两前缀和的大小关系,然后通过拓扑排序得到前缀和的大小序列,确定每个前缀和的大小,最后得到结果#include <iostream> #include <cstdio> #include <string.h> using namespace std; const int maxn=11; int e[maxn][maxn],b[maxn],in[maxn],sol[maxn]; int n,loc; void topo()//基于栈的topo排序 { int i 阅读全文
posted @ 2013-03-01 17:46 LJ_COME!!!!! 阅读(159) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 17 下一页