![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树
LSC__lsc
这个作者很懒,什么都没留下…
展开
-
HDU-4027 Can you answer these queries?(线段树+开根操作)
A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of end...原创 2019-01-31 15:10:00 · 160 阅读 · 0 评论 -
HDU 6638 Snowy Smile (2019杭电多校第六场)(最大连续区间和)
题目链接Snowy SmileTime Limit: 4000/4000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1644 Accepted Submission(s): 501Problem DescriptionThere are n pirate c...原创 2019-08-08 20:02:51 · 321 阅读 · 0 评论 -
HDU-6602 Longest Subarray(2019杭电多校第二场1012)
题目链接Problem DescriptionYou are given two integers C,K and an array of N integers a1,a2,…,aN. It is guaranteed that the value of ai is between 1 to C.We define that a continuous subsequence al,al+1,...原创 2019-07-26 19:47:36 · 150 阅读 · 0 评论 -
Codeforces Round #576 (Div. 2) D. Welfare State
题目链接There is a country with n citizens. The i-th of them initially has ai money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, ...原创 2019-07-31 10:33:48 · 156 阅读 · 0 评论 -
HDU-6609 Find the answer (2019杭电多校第三场1007)
题目链接Find the answerTime Limit: 4000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 470 Accepted Submission(s): 149Problem DescriptionGiven a sequence of...原创 2019-07-29 21:13:07 · 221 阅读 · 0 评论 -
2018-2019 Pacific Northwest Regional (Div. 1) F Rectangles(线段树扫描线)
题目链接题意: 矩形覆盖面积奇数次的面积和思路: 线段树节点每次更新只用看其覆盖奇数次还是偶数次,反转一下即可!!节点的权值也要反转,当前区间长度-上次区间权值 即为节点反转后的权值。仔细想一下即可。#include<bits/stdc++.h>using namespace std;#define ll long long#define lson (rt<<...原创 2019-05-11 11:48:39 · 175 阅读 · 0 评论 -
HDU 3410 Passing the Message 三种方法(暴力,单调栈,线段树+DFS)
Passing the MessageTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1283 Accepted Submission(s): 836Problem DescriptionWhat a sunny day! L...原创 2019-05-04 19:43:43 · 166 阅读 · 0 评论 -
HDU-4614 Vases and Flowers(线段树+区间修改+二分)
题目链接Problem Description Alice is so popular that she can receive many flowers everyday. She has N vases numbered from 0 to N-1. When she receive some flowers, she will try to put them in the vases,...原创 2019-02-26 15:37:28 · 167 阅读 · 0 评论 -
HDU - 3974 Assign the task(DFS序+线段树维护)
题目链接Problem DescriptionThere is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole company).If you are the immedi...原创 2019-02-17 21:46:51 · 141 阅读 · 0 评论 -
ZOJ-1610 Count the Colors(线段树,区间更新)
题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1610Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task...原创 2019-01-30 13:39:43 · 167 阅读 · 0 评论 -
HDU-1540 Tunnel Warfare (线段树+最大连续区间)
During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Except t...原创 2019-02-06 19:58:16 · 198 阅读 · 0 评论 -
2019 CCPC 网络赛 HDU - 6703 array(线段树)
Problem DescriptionYou are given an array a1,a2,…,an(∀i∈[1,n],1≤ai≤n). Initially, each element of the array is unique.Moreover, there are m instructions.Each instruction is in one of the following ...原创 2019-08-24 11:00:04 · 501 阅读 · 3 评论