摘要: 题目链接数据范围较小,直接离散后暴力。等等学习一下线段树的思路。 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <algorithm> 5 using namespace std; 6 #define N 101 7 #define eps 1e-6 8 double xr[N],xc[N],yr[N],yc[N]; 9 double x[3*N],y[3*N];10 int dblcmp(double x)11 {12 if(fabs(x) < 阅读全文
posted @ 2013-04-24 15:44 Naix_x 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 题目链接此题挺裸的模版的,然后多组的判断,让我WA了很多次,用flag标记一下,就好。。。 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 #define N 60000 6 #define C_NUM 128 7 int trie[N][C_NUM]; 8 int o[N],fail[N],que[N],flag[N]; 9 int t,num; 10 void CL() 11 { 12 memset(trie,-1,sizeo 阅读全文
posted @ 2013-04-24 14:10 Naix_x 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 题目链接这题在经过强哥讲解,看了很多题解之后AC了,矩阵乘法回顾了一下,然后AC自动机换了一份模版。。。慢慢理解。。 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<string> 5 using namespace std; 6 #define N 1000001 7 #define LL __int64 8 int t; 9 int tire[N][4]; 10 int que[N]; 11 int o[N]; 12 int fail[N]; 13 阅读全文
posted @ 2013-04-24 10:22 Naix_x 阅读(158) 评论(0) 推荐(0) 编辑