上一页 1 ··· 46 47 48 49 50 51 52 53 54 ··· 59 下一页
摘要: #include#include#include#define N 1100struct node { int x,y;}map[N];int s[N];int pre[N];int find(int n) { if(n!=pre[n]) pre[n]=find(pre[n]); return p... 阅读全文
posted @ 2013-11-18 13:01 HYDhyd 阅读(95) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#define N 1100int map[N];int main() {int i,k,n,m,a,b;while(scanf("%d%d",&n,&m)!=EOF) {memset(map,0,sizeof(map));for(i=0;i<m;i+... 阅读全文
posted @ 2013-11-17 22:24 HYDhyd 阅读(111) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;struct node {int num,i;node *a[27];node (){num=0;for(i=0;ia[str[i]-'a']==NULL) {q=new node();q->num++;root... 阅读全文
posted @ 2013-11-17 16:41 HYDhyd 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 个人觉得这个模板比较好http://www.tuicool.com/articles/6Fv2Ej模仿这个模板我写的poj上的2001#include#include#includeusing namespace std;struct node {int num;node *a[27]; node... 阅读全文
posted @ 2013-11-17 16:18 HYDhyd 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;struct trie {trie *a[27];int v;}*h,*t;int len,k;char str[1100][30];void build(int count,trie *h) {int i,j;... 阅读全文
posted @ 2013-11-17 15:37 HYDhyd 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#includeusing namespace std;mapmymap;int main() {int i,j,k,n,m;char s[4000],str[30],str2[30];string str1; sc... 阅读全文
posted @ 2013-11-14 10:29 HYDhyd 阅读(143) 评论(0) 推荐(0) 编辑
摘要: #include#define N 100100struct node {int x,y,yanchi;}a[N*4];//注意数组范围void build(int t,int x,int y) {a[t].x=x;a[t].y=y;a[t].yanchi=1;if(x==y)return ;int... 阅读全文
posted @ 2013-11-13 20:22 HYDhyd 阅读(138) 评论(0) 推荐(0) 编辑
摘要: #include//数据弱线段树延迟更新水过#define N 100100struct node {int x,y,yanchi,num;}a[N*4];void build(int t,int x,int y) {a[t].x=x;a[t].y=y;a[t].yanchi=0;a[t].num=... 阅读全文
posted @ 2013-11-13 19:55 HYDhyd 阅读(139) 评论(0) 推荐(0) 编辑
摘要: //用二分查找,先找到x小于等于m的有几个数这些数有可能y大于u即为符合。//然后找这些数中y小于u的即为排除//相减即可#include#include#define N 100100struct node {int x,y;}a[N],b[N];int n;int cmp1(const void... 阅读全文
posted @ 2013-11-13 19:08 HYDhyd 阅读(135) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 30int map[N][4],total;void dfs(int n,int count,int end,int path[N],int h[N]) {int i;path[count]=n;//记录for(i=0;ib) {t=a;a=b;b... 阅读全文
posted @ 2013-11-13 15:06 HYDhyd 阅读(85) 评论(0) 推荐(0) 编辑
上一页 1 ··· 46 47 48 49 50 51 52 53 54 ··· 59 下一页