![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
HYSBZ
南宮逸辰
喜欢听音乐,ACM旅途中
展开
-
HYSBZ-1878-HH的项链
这个题需要用离线算法加树状数组做,将所有的查询按区间右边排序,然后用树状数组进行更新维护 代码: #include #include #include using namespace std; const int maxn=302; int n,m,t[maxn][maxn][102],a[maxn][maxn]; int lowbit(int x) { return x&(-x);原创 2013-07-22 16:35:49 · 852 阅读 · 0 评论 -
HYSBZ-2743-采花
跟上个题比较像,也是离线算法+树状数组 代码: #include #include #include #include using namespace std; const int maxn=50010; const int maxa=1e6+100; const int maxb=200011; struct node { int pre; int last; int原创 2013-07-22 16:38:01 · 907 阅读 · 0 评论