![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
模板
夜拾柒
In the future, there will be no retreat in horror.
展开
-
线段树模板
线段树点更新: struct node{ int l,r,maxn,sum; }tree[N<<2]; void build(int m,int l,int r){ tree[m].l = l; tree[m].r = r; if(l == r){ tree[m].maxn = a[l];//先将每个底层节点的数据存储在a[i]中,建树时原创 2016-07-24 11:36:58 · 217 阅读 · 0 评论 -
JAVA大数操作
大数据操作指的是数字非常大,大到已经超过了整个数据类型的保存范围,需要使用对象的形式进行操作。 一、BigInteger BigInteger表示大的整型数据 import java.math.BigInteger; public class BigIntegers { public static void main(String[] args) {转载 2016-04-13 22:18:23 · 300 阅读 · 0 评论 -
大数模板
使用运算符重载的方法来实现大数的加,减,乘和除,包括n次方、取模、大小比较、赋值以及输入流、输出流。这道题的代码是解决杭电1134Catalan计数问题。 #include #include #include #include #include #include using namespace std; #define MAX转载 2015-10-08 15:21:29 · 335 阅读 · 2 评论 -
STL之优先队列
优先级队列,以前刷题的时候用的比较熟,现在竟然我只能记得它的关键字是priority_queue(太伤了)。在一些定义了权重的地方这个数据结构是很有用的。 先回顾队列的定义:队列(queue)维护了一组对象,进入队列的对象被放置在尾部,下一个被取出的元素则取自队列的首部。priority_queue特别之处在于,允许用户为队列中存储的元素设置优先级。这种队列不是直接将新元素放置在队列尾部,而转载 2016-07-26 21:07:12 · 255 阅读 · 0 评论