线段树
reedthink
学习不是百米赛跑,是马拉松。要长久的保持热情。
。。。。。。。。。。。。。。。。。。。。要少水群
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
51nod 1174 (线段树练习 )
题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1174 题意:求区间最大数。单点更新,段求值。 用线段树 #include <algorithm> #include <stdio.h> using namespace std; struct uct { int m...原创 2018-10-17 15:54:03 · 287 阅读 · 0 评论 -
POJ 3468 A simple problem with Integers (线段树区间更新,区间查询) 2/5
题目链接:http://poj.org/problem?id=3468 首先,感谢雨巨的线段树入门视频,可算让我整明白线段树的原理,还学到了一些编码的技巧。orz,再次感谢雨巨。 这道题目就是裸的线段树,区间更新,区间查询 代码: #include <stdio.h> typedef long long ll; struct SeTreeNode { int lef...原创 2018-11-02 20:40:18 · 157 阅读 · 0 评论 -
2019 杭电 多校第二场 1011 Keen On Everything But Triangle
题目链接 题意 : N条线段,Q次查询。查询的是区间内线段能组成的周长最长的三角形的周长。 分析: 首先,对于三条线组成周长最长三角形的问题,我们将线段排序后从大到小依次枚举,然后判断是否能构成三角形。值得注意的是,在最坏情况下我们也只需枚举几十次。因为最坏情况是斐波那契数列,然而斐波那契数列几十个之后就在数据范围之外了。既然是区间查询问题,我们考虑使用线段树或者主席树,然而发现线段树维护区间有序...原创 2019-07-25 15:26:32 · 311 阅读 · 0 评论 -
codeforce 750E
#include <bits/stdc++.h>//codeforce 750E(https://codeforces.com/contest/750/problem/E) using namespace std; const int maxn = 1000050; typedef pair<int, int> P; typedef long long ll; const ...原创 2019-09-10 21:43:27 · 271 阅读 · 0 评论
分享