![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 558 阅读 · 0 评论 -
HDUOJ 1166 敌兵布阵
单点更新+区间求和#include#include#includeusing 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 · 442 阅读 · 0 评论 -
HDUOJ 1698 Just a Hook
区间修改+单点查询#include#include#includeusing 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 · 526 阅读 · 0 评论 -
HDUOJ 1754 I Hate It
维护区间最值#include#include#include#include#includeusing 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 · 561 阅读 · 0 评论