摘要: 题目:http://poj.org/problem?id=3468代码:View Code 1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 __int64 s[400010]; 5 __int64 t[400010];//延迟数组,标记 6 void push(int w) 7 { 8 s[w]=s[w*2]+s[w*2+1]; 9 }10 void pushdown(int w, int d)11 {12 if(t[w])//如果延迟,向下更新13 {14 t[w*2]... 阅读全文
posted @ 2012-08-13 22:01 琳&leen 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=1500View Code 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<stdlib.h> 5 using namespace std; 6 struct node 7 { 8 int flag; 9 node *next[26];10 };11 int num;12 node *build()1 阅读全文
posted @ 2012-08-13 20:36 琳&leen 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1075View Code 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<stdlib.h> 5 using namespace std; 6 struct node 7 { 8 int flag; 9 char st[101]; 10 node *next[26]; 11 }; 12 node *build() 13 { 14 int i; 15 n... 阅读全文
posted @ 2012-08-13 20:34 琳&leen 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1247View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 char str[50010][105]; 6 struct node 7 { 8 int flag; 9 node *next[26];10 };11 node *build()12 {13 int i;14 node *p;15 p=new node;16 ... 阅读全文
posted @ 2012-08-13 20:32 琳&leen 阅读(140) 评论(0) 推荐(0) 编辑