HDU
Mixfix
自己选择的路,哪怕是跪着也要走完!!!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDUOJ 2795 Billboard
很经典的线段树题目,只需要每次找尽量靠上并且能放下这块板的位置就行了。 p.s:注意(1 n,h等于n就行了,因为最多只有n块板。 #include #include #include #include #define For(x, y) for(int i=x; i<=y; i++) #define Lson l,mid,k<<1 #define Rson mid+1,r,k<<1|1 #d原创 2014-12-21 09:29:53 · 629 阅读 · 0 评论 -
HDUOJ 1166 敌兵布阵
单点更新+区间求和 #include #include #include using namespace std; const long M=50005; struct Seb_tree { long l; long r; long long sum; }; Seb_tree t[M*4+1]; long s[M]; long long total=0; long n,m原创 2014-12-14 17:41:17 · 511 阅读 · 0 评论 -
HDUOJ 1698 Just a Hook
区间修改+单点查询 #include #include #include using namespace std; const int M=100005; struct Seb_tree { int l; int r; int col; }; Seb_tree t[M*4+1]; int n, m, nn; void build(int l, int r, int k) { t[原创 2014-12-14 17:44:46 · 583 阅读 · 0 评论 -
HDUOJ 1754 I Hate It
维护区间最值 #include #include #include #include #include using namespace std; const int M=200005; struct RMQ { int l; int r; int maxx; }; RMQ t[M*4+1]; int s[M*2]; int n,m; int res=0; void add(int x, i原创 2014-12-14 17:44:11 · 629 阅读 · 0 评论
分享