HYSBZ
南宮逸辰
喜欢听音乐,ACM旅途中
展开
-
HYSBZ-1878-HH的项链
这个题需要用离线算法加树状数组做,将所有的查询按区间右边排序,然后用树状数组进行更新维护代码:#include#include#includeusing 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 · 849 阅读 · 0 评论 -
HYSBZ-2743-采花
跟上个题比较像,也是离线算法+树状数组代码:#include#include#include#includeusing 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 · 903 阅读 · 0 评论