POJ2309BST【树状数组的理解】
2014-09-24 21:38
162 查看
大意:
对于这个树
View Code
对于这个树
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int lowbit(int x) { return x & ( - x ); } int main() { int n; int t; scanf("%d",&t); while(t--) { scanf("%d",&n); int n1 = n - lowbit(n); printf("%d", n1 + 1); int n2 = n + lowbit(n); printf(" %d\n", n2 - 1); } }
View Code
相关文章推荐
- POJ2309BST【树状数组的理解】
- POJ2309BST(树状数组)
- POJ2309 BST(树状数组)
- 树状数组的理解
- POJ 2309 BST 树状数组基本操作
- 数据结构:线段树(树状数组、BST、LCA、
- 树状数组的理解
- -----树状数组的理解
- 【算法】逆序对问题的四种解法(归并排序,BST,树状数组,线段树)及变形
- 树状数组的大概理解
- 【树状数组】POJ 2309 BST
- hdu5975_Aninteresting game_树状数组理解
- 树状数组点更新,区间更新理解
- POJ 2309 BST 树状数组基本操作
- HDU1166 敌兵布阵 树状数组|线段树-构造完全二叉树(理解)
- 对于树状数组的理解
- 深入理解树状数组
- 树状数组浅显理解以及Ultra-QuickSort的AC代码
- 树状数组理解
- 仔细理解线段树和树状数组