
线段树
Evildoer_llc
这个作者很懒,什么都没留下…
展开
-
hdu 1166 敌兵布阵 (线段树基础 线段树版)单点修改,区间查询
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166 Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵...原创 2018-11-25 23:26:12 · 116 阅读 · 0 评论 -
hdu 1394 Minimum Inversion Number (线段树版本)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int maxn = 5050; struct node { int l, r; in...原创 2018-11-28 23:32:54 · 132 阅读 · 0 评论 -
hdu 2795 Billboard (线段树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2795 At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the pl...原创 2018-11-28 23:34:23 · 166 阅读 · 0 评论 -
hdu 1754 I Hate It (单点更新,区间查询)线段树第二题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1754 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input...原创 2018-11-27 00:12:04 · 211 阅读 · 0 评论 -
hdu 1394 Minimum Inversion Number (线段树第三题) 暴力法
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394 The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj. For a...原创 2018-11-28 00:18:51 · 140 阅读 · 0 评论