随笔分类 -  数据结构---树状数组,线段树

摘要:题目描述 You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each n 阅读全文
posted @ 2016-09-21 20:54 Pic 阅读(173) 评论(0) 推荐(0)
摘要:Description As is known to all, the blooming time and duration varies between different kinds of flowers. Now there is a garden planted full of flower 阅读全文
posted @ 2016-09-17 22:06 Pic 阅读(146) 评论(0) 推荐(0)
摘要:``` const int M; struct node{ int max; int sum; int left; int right; }tree[4*M];//线段树数组 int a[M];//原始数据数组 //*********************// void build(int id,int left,int right)//递归建树 { if... 阅读全文
posted @ 2016-09-12 22:30 Pic 阅读(120) 评论(0) 推荐(0)
摘要:Description In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping 阅读全文
posted @ 2016-09-11 22:02 Pic 阅读(181) 评论(0) 推荐(0)