上一页 1 2 3 4 5 6 7 8 9 10 ··· 44 下一页
摘要: 题目链接水题依旧无法1Y。 1 #include 2 #include 3 #include 4 using namespace std ; 5 #define LL __int64 6 LL gcd(LL a,LL b) 7 { 8 return b == 0?a:gcd(b,a%b); 9 }10 11 int main()12 {13 LL a,b,x,y,t;14 LL str,end,mid;15 scanf("%I64d%I64d%I64d%I64d",&a,&b,&x,&y);16 t = gcd(x,y);17 x = x/. 阅读全文
posted @ 2013-10-19 12:28 Naix_x 阅读(177) 评论(0) 推荐(0)
摘要: 题目链接AC了。经典问题,a*x+b*y+c = 0整数点,有些忘记了扩展欧几里德,复习一下。 1 #include 2 #include 3 #include 4 using namespace std ; 5 #define LL __int64 6 LL x,y; 7 LL ext_eulid(LL a,LL b) 8 { 9 LL t,d;10 if(b == 0)11 {12 x = 1;13 y = 0;14 return a;15 }16 d = ext_eulid(b,a%b);17 ... 阅读全文
posted @ 2013-10-19 11:08 Naix_x 阅读(233) 评论(0) 推荐(0)
摘要: 题目链接水题,卡了下下精度。 1 #include 2 #include 3 #include 4 using namespace std ; 5 #define PI acos(-1.0) 6 #define eps 1e-8 7 int judge(double x,double y) 8 { 9 double a;10 a = x-y;11 if(a eps)32 {33 swap(ly,ry);34 swap(lx,rx);35 }36 else if(jud... 阅读全文
posted @ 2013-10-18 19:11 Naix_x 阅读(186) 评论(0) 推荐(0)
摘要: 题目链接折腾了半天,没想出怎么证明,以前初中老师教过,不知道怎么办,就量量。。。受不了,怒抄模版1Y。。。 1 #include 2 #include 3 using namespace std; 4 #define eps 1e-8 5 struct point 6 { 7 double x,y; 8 }; 9 struct line10 {11 point a,b;12 };13 point intersection(line u,line v)14 {15 point ret = u.a;16 double t = ((u.a.x-v.a.x)*(v.... 阅读全文
posted @ 2013-10-17 10:27 Naix_x 阅读(246) 评论(0) 推荐(0)
摘要: 可能开始宿舍比较乱,思绪静不下来。。。想了大半个小时,终于确定了应该暴力+DP,然后写了枚举除数,和被除的版本。。这样,还敲错了个字母,第一次提交还100多,修改提交还有75.多,最后想到,貌似不打对啊,改完再交就剩下75了。。。还好,没挂0。。。这样写,还是比较好写的,最后10分钟,开始改,最后4分钟改完。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define LL long long 9 int dp[62][61];10 int g... 阅读全文
posted @ 2013-10-16 11:19 Naix_x 阅读(337) 评论(0) 推荐(0)
摘要: 脑子又卡了。。。来一发set的,STL真心不熟。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int flag[400001]; 7 setse; 8 set::iterator it1,it,it2; 9 int main()10 {11 int i,x,y,num,n,m;12 scanf("%d%d",&n,&m);13 for(i = 1; i <= n; i ++)14 se.insert(i);15 for(i = 1; i <= m... 阅读全文
posted @ 2013-10-16 11:11 Naix_x 阅读(195) 评论(0) 推荐(0)
摘要: 题目链接卡了一下精度和内存。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define eps 1e-8 9 #define N 100000110 #define LL __int6411 int a[9] = {-1,0,1,-1,0,1,-1,0,1};12 int b[9] = {-1,-1,-1,0,0,0,1,1,1};13 char str[N];14 LL cross(LL x1,LL y1,LL x2,LL y2)15 {16... 阅读全文
posted @ 2013-10-15 18:35 Naix_x 阅读(164) 评论(0) 推荐(0)
摘要: 题目链接2Y,模版抄错了一点。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define eps 1e-8 8 #define N 2001 9 struct point10 {11 double x,y;12 }p[N],pre[N],temp[N];13 double a,b,c;14 int n,m;15 void getline(point x,point y)16 {17 a = y.y - x.y;18 b = x.x - y.x;... 阅读全文
posted @ 2013-10-15 16:54 Naix_x 阅读(188) 评论(0) 推荐(0)
摘要: 题目链接小小的模拟一下。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 char str[1000]; 8 double a[10]; 9 double b[10];10 void CL()11 {12 a[0] = a[2] = 0.0;13 a[4] = a[5] = sqrt(2.0)/2.0;14 a[1] = 1.0;15 a[3] = -1.0;16 a[6] = a[7] = -sqrt(2.0)/2.0;17 ... 阅读全文
posted @ 2013-10-15 16:32 Naix_x 阅读(236) 评论(0) 推荐(0)
摘要: 题目链接抄的外心模版。然后,输出认真一点。1Y。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define eps 1e-8 8 struct point 9 {10 double x,y;11 };12 struct line13 {14 point a,b;15 };16 point intersection(line u,line v)17 {18 point ret = u.a;19 double t = ((u.a.x-v.a... 阅读全文
posted @ 2013-10-14 21:20 Naix_x 阅读(275) 评论(0) 推荐(0)
摘要: 题目链接回忆了一下,半平面交,整理了一下模版。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define eps 1e-8 8 #define N 2001 9 struct point10 {11 double x,y;12 }p[N],temp[N],pre[N];13 int n,m;14 double a,b,c;15 void getline(point x,point y)16 {17 a = y.y - x.y;18 b = x.... 阅读全文
posted @ 2013-10-14 20:13 Naix_x 阅读(224) 评论(0) 推荐(0)
摘要: 题目链接很简单的一题,数据 很小,直接暴力的。但是也是写也好久,有几个数,没算好。。。一次CE,一次PE,3Y。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define eps 1e-8 8 #define zero(x) (((x) > 0?(x):-(x))<eps) 9 int o[200];10 struct point11 {12 double x,y;13 } p[1001];14 double dis(point p1,point p2)15 ... 阅读全文
posted @ 2013-10-14 17:09 Naix_x 阅读(228) 评论(0) 推荐(0)
摘要: 题目链接抄的模版,居然1Y了。就是简单的线段相交+并查集。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define eps 1e-8 8 #define zero(x) (((x) > 0?(x):(-x)) eps;35 }36 int interset_in(line u,line v)37 {38 if(!dots_online(u.a,u.b,v.a)||!dots_online(u.a,u.b,v.b))39 return !same_si... 阅读全文
posted @ 2013-10-11 16:41 Naix_x 阅读(190) 评论(0) 推荐(0)
摘要: 题目链接切计算几何,感觉计算几何的算法还不熟。此题,枚举线段和圆点的直线,平分一个圆 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define eps 1e-8 8 struct point 9 {10 double x,y;11 }p[201];12 double dis(point p1,point p2)13 {14 return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));15 }... 阅读全文
posted @ 2013-10-11 15:56 Naix_x 阅读(210) 评论(0) 推荐(0)
摘要: 题目链接 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 int dp[101][101]; 9 char str[101];10 int judge(int x,int y)11 {12 if(str[x] == '['&&str[y] == ']')13 return 1;14 else if(str[x] == '('&&str[y] == ')')15 ret 阅读全文
posted @ 2013-10-10 18:59 Naix_x 阅读(160) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 44 下一页