《信息學奧賽一本通·提升篇》——數據結構——樹狀數組——例題2-數星星Stars(urall1028)——第213面...

思路: x,y座標按升序排列,故可把二維樹狀轉化爲一維樹狀。 #include<iostream> using namespace std; const int maxn=32005; int n,a[maxn]; int ans[maxn],c[maxn]; struct node { int x;int y; }p[maxn]; int lowbit(int x) { return
相關文章
相關標籤/搜索