![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树状数组
synapse7
这个作者很懒,什么都没留下…
展开
-
POJ 3067 Japan(树状数组求逆序对)
Japan http://poj.org/problem?id=3067 Time Limit: 1000MS Memory Limit: 65536K Description Japan plans to welcome the ACM ICPC World Finals and a lot of roads must b原创 2013-07-27 12:48:48 · 1394 阅读 · 0 评论 -
UVa 1513 / UVALive 5902 Movie collection (树状数组)
5902 - Movie collection Time limit: 3.000 seconds https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=3913 Mr. K. I. has a very big原创 2013-08-31 21:01:44 · 2055 阅读 · 0 评论 -
POJ 1195 Mobile phones(二维树状数组)
Mobile phones http://poj.org/problem?id=1195 Time Limit: 5000MS Memory Limit: 65536K Description Suppose that the fourth generation mobile phone base stations in the Tampere area operat原创 2013-08-01 23:53:04 · 1005 阅读 · 0 评论 -
POJ 1990 MooFest(想法题&树状数组)
MooFest http://poj.org/problem?id=1990 Time Limit: 1000MS Memory Limit: 30000K Description Every year, Farmer John's N (1 <= N <= 20,000) cows attend "MooFest",a social gathering of cows fr原创 2013-08-01 22:35:59 · 1845 阅读 · 0 评论 -
树状数组、线段树模板(一)——单点更新 + HDU 1166 敌兵布阵
http://acm.hdu.edu.cn/showproblem.php?pid=1166 此题考查RSQ(Range Sum Query)。 模板如下: /*343ms,744KB*/ /* 我们使用如下缩写: root--整棵树的根节点 rt--当前区间的根节点 l,r--区间左右端点 m--区间的二等分点,注意m是落在左子区间的(右端点) lson,rson-原创 2013-07-26 00:21:10 · 1114 阅读 · 0 评论 -
UVa 12086 Potentiometers (树状数组&点修改)
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=502&page=show_problem&problem=3238 更新语句改为update(x, y - query(x, x));即可。 /*0.259s*/ const int mx = 200005; int N, tr原创 2014-03-08 11:46:54 · 963 阅读 · 0 评论 -
Beijing 2008 / UVa 1428 / POJ 3928 / HDU 2492 Ping pong (树状数组)
Ping pong http://poj.org/problem?id=3928;http://acm.hdu.edu.cn/showproblem.php?pid=2492 Time Limit: 1000MS Memory Limit: 65536K Description N(3<=N<=20000) ping pong players原创 2013-07-27 21:35:34 · 1044 阅读 · 0 评论 -
LightOJ 1085 All Possible Increasing Subsequences (DP&离散化&树状数组)
http://lightoj.com/volume_showproblem.php?problem=1085 先说个很快的方法——二维思考,从右下往左上离散化: /*0.364s,2860KB*/ #include using namespace std; const int mx = 100005; const int mod = 1000000007; int tree[m原创 2014-03-25 21:28:21 · 1601 阅读 · 0 评论