
模板
蚕豆儿
这个作者很懒,什么都没留下…
展开
-
线段树模板
线段树模板,存着。 //线段树模板 struct line { int left,right;//左端点、右端点 int n;//记录这条线段出现了多少次,默认为0 }; struct line a[100]; int sum; //建立 void build(int s,int t,int n) { int mid=(s+t)/2; a[n].left=s; a[n].right=t; if原创 2013-08-23 17:05:47 · 597 阅读 · 0 评论 -
Multiple of 17(湖南省第六届ACM竞赛题)含有java大数模板
Multiple of 17 Time Limit:1000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 11879 Description Theorem: If you drop the last digit d of an integ原创 2013-09-04 14:46:46 · 1145 阅读 · 0 评论 -
hdu 1002 A + B Problem II(大数模板)
http://acm.hdu.edu.cn/showproblem.php?pid=1002 大数运算,用数组存数据,参考刘汝佳的《算法竞赛入门经典》里面写的,顺便套模板。 还可以用这个模板来写减法、乘法。 除法运算暂时不清楚如果有小数怎么处理。。。 AC代码: #include #include #include using namespace std; #define原创 2013-08-31 09:40:46 · 851 阅读 · 0 评论 -
hdu 统计难题(字典树)
http://acm.hdu.edu.cn/showproblem.php?pid=1251 字典树模板: 代码: /************ HDU 1251 统计难题 字典树模板 **************/ #include #define MAX 26 typedef struct TrieNode { int nCount; struct T转载 2013-08-21 19:36:16 · 698 阅读 · 0 评论 -
hdu 1166 敌兵布阵(线段树,树状数组)
http://acm.hdu.edu.cn/showproblem.php?pid=1166 直接线段树模板 AC代码: #include #include #include using namespace std; struct node { int l; //左起点 int r; //右终点 int sum; //区间数据总和 }; node p原创 2013-09-03 13:44:12 · 928 阅读 · 0 评论 -
优先队列的用法
转载来源:http://www.cppblog.com/shyli/archive/2007/04/06/21366.html 在优先队列中,优先级高的元素先出队列。 标准库默认使用元素类型的 优先队列的第一种用法,也是最常用的用法: priority_queueint> qi; 通过 故示例1中输出结果为:9 6 5 3 2 第二种方法: 在示例1中,如果我们要把转载 2013-09-18 14:47:09 · 610 阅读 · 0 评论