
线段树
EIP_silly
此人不懒,但也没写什么
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ-3470 Walls
POJ-3470 Walls Time Limit: 6000MS Memory Limit: 131072K Total Submissions: 2624 Accepted: 402 Case Time Limit: 3000MS Description There are N walls. A wall has an infinity height, so it looks like a...原创 2020-01-27 17:27:21 · 356 阅读 · 0 评论 -
POJ-3109 Inner Vertices (扫描线 + 离散化 + 树状数组)
Inner Vertices Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 3253 Accepted: 954 Case Time Limit: 2000MS Description There is an infinite square grid. Some vertices of the grid are black...原创 2020-01-26 22:16:16 · 297 阅读 · 0 评论 -
牛客多校第八场 E - Explorer(时间分治 + 离散化 + 并查集 + 线段树)
巧妙的时间分治思想 根据通道的大小的大小建立一棵线段树。 对于每条边,根据它 l 和 r的大小把它放到线段树对应的位置。 然后从根开始dfs,每经过一个结点,就把结点存的边都加进来,通过并查集维护,跑到叶子结点的时候,判断一下1和n在不在同一个并查集中,在的话表明叶子节点所代表的大小可以使得主角从1抵达n,把它记录下来。合并并查集的时候按秩合并 观察题目给的数据范围可知n和m都在1e5里面,...原创 2019-08-15 12:33:26 · 251 阅读 · 0 评论 -
HDU - 3577 Problem Description
HDU - 3577 Problem Description Chinese always have the railway tickets problem because of its’ huge amount of passangers and stations. Now goverment need you to develop a new tickets query system. On...原创 2019-07-16 20:35:16 · 223 阅读 · 0 评论 -
POJ - 3468 A Simple Problem with Integers
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 156222 Accepted: 48325 Case Time Limit: 2000MS Description You have N integers, A1, A2, … , AN. You need to...原创 2019-05-10 18:32:44 · 260 阅读 · 0 评论 -
HDU - 1698 Just a Hook
#include #include<stdio.h> using namespace std; struct node{ int left,right,value,type; void change(int num) { value = (right - left + 1) * num; type = num; } }; struct segtree{ node tree[400000...原创 2019-05-09 17:59:17 · 218 阅读 · 0 评论 -
POJ - 3648 A Simple Problem with Integers (树状数组)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 152104 Accepted: 47157 Case Time Limit: 2000MS Description You have N integers, A1, A2, … , AN. You need to...原创 2019-03-23 10:08:44 · 524 阅读 · 0 评论 -
POJ - 2481 Cows 树状数组
POJ - 2481 Cows Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 23766 Accepted: 7987 Description Farmer John’s cows have discovered that the clover growing along the ridge of the hill (wh...原创 2019-03-22 23:12:25 · 517 阅读 · 0 评论 -
Codeforces Problem - 652D - Nested Segments
D. Nested Segments time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given n segments on a line. There are no ends of some segments that...原创 2019-03-23 13:04:39 · 305 阅读 · 0 评论 -
HDU - 1754 I Hate It
I Hate It Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 112144 Accepted Submission(s): 41863 Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某...原创 2019-03-23 10:30:57 · 303 阅读 · 0 评论 -
POJ - 2155 Matrix
Matrix Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 34283 Accepted: 12403 Description Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row ...原创 2019-03-25 08:56:13 · 346 阅读 · 0 评论