
树状数组
synapse7
这个作者很懒,什么都没留下…
展开
-
POJ 3067 Japan(树状数组求逆序对)
Japanhttp://poj.org/problem?id=3067Time Limit: 1000MSMemory Limit: 65536KDescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads must b原创 2013-07-27 12:48:48 · 1448 阅读 · 0 评论 -
UVa 1513 / UVALive 5902 Movie collection (树状数组)
5902 - Movie collectionTime limit: 3.000 secondshttps://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=3913Mr. K. I. has a very big原创 2013-08-31 21:01:44 · 2083 阅读 · 0 评论 -
POJ 1195 Mobile phones(二维树状数组)
Mobile phoneshttp://poj.org/problem?id=1195Time Limit: 5000MSMemory Limit: 65536KDescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operat原创 2013-08-01 23:53:04 · 1024 阅读 · 0 评论 -
POJ 1990 MooFest(想法题&树状数组)
MooFesthttp://poj.org/problem?id=1990Time Limit: 1000MSMemory Limit: 30000KDescriptionEvery year, Farmer John's N (1 <= N <= 20,000) cows attend "MooFest",a social gathering of cows fr原创 2013-08-01 22:35:59 · 2049 阅读 · 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 · 1134 阅读 · 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 · 986 阅读 · 0 评论 -
Beijing 2008 / UVa 1428 / POJ 3928 / HDU 2492 Ping pong (树状数组)
Ping ponghttp://poj.org/problem?id=3928;http://acm.hdu.edu.cn/showproblem.php?pid=2492Time Limit: 1000MSMemory Limit: 65536KDescriptionN(3<=N<=20000) ping pong players原创 2013-07-27 21:35:34 · 1074 阅读 · 0 评论 -
LightOJ 1085 All Possible Increasing Subsequences (DP&离散化&树状数组)
http://lightoj.com/volume_showproblem.php?problem=1085先说个很快的方法——二维思考,从右下往左上离散化:/*0.364s,2860KB*/#includeusing namespace std;const int mx = 100005;const int mod = 1000000007;int tree[m原创 2014-03-25 21:28:21 · 1662 阅读 · 0 评论