
线段树
文章平均质量分 59
NoobPlayer_llke
除了编程啥都会点
展开
-
POJ 3264 Balanced Lineup (线段树查找最大最小值)
http://poj.org/problem?id=3264 题意:给你一个长度为n的序列a[N] (1 ≤ N ≤ 50000),询问Q(1 ≤ Q ≤ 200000) 次,每次输出【L, R】区间最大值与最小值的差是多少。 只需把模板的求和改成求最大和最小即可 #include <string.h> #include <algorithm> #include &...原创 2018-08-18 23:49:39 · 246 阅读 · 0 评论 -
HDU 1689 Just a Hook (线段树区间更新+求和)
Just a Hook Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 43680 Accepted Submission(s): 20891 Problem Description In the game of DotA...原创 2018-08-18 23:34:45 · 134 阅读 · 0 评论 -
HDU 4027 (线段树区间更新)
Can you answer these queries? Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 24587 Accepted Submission(s): 5821 Problem Description A ...原创 2018-08-19 17:04:02 · 186 阅读 · 0 评论 -
线段树3道超级基础模板题
CODEVS 1080 线段树练习 http://codevs.cn/problem/1080/ 单点修改 区间查询 #include<bits/stdc++.h> #define inf 0x3f3f3f3f; const int maxn = 1e5+5; using namespace std; struct node { int l,r,w; }tree[4*max...原创 2018-08-17 00:14:23 · 186 阅读 · 0 评论 -
坑死在main部分的线段树
Kuangbin带我飞专题七——线段树 下面虽然都是线段树裸的模板题,但是都没有一次AC掉,在main部分出现各种各样的问题 HDU 1166 敌兵布阵 https://vjudge.net/problem/HDU-1166 这道题写过好多遍了,今天重新刷还是一直WA ; 查了半小时错发现原因在于开始我用的 ios::sync_with_stdio(false); 配合 ci...原创 2018-08-17 00:46:03 · 149 阅读 · 0 评论 -
Master of GCD 【线段树区间更新 || 差分】
Master of GCD 时间限制:1 Sec内存限制:128 MB 提交:670解决:112 [提交] [状态] [命题人:admin] 题目描述 Hakase has n numbers in a line. At fi rst, they are all equal to 1. Besides, Hakase is interested in primes. She...原创 2019-04-05 20:21:51 · 173 阅读 · 0 评论