摘要: 线段树上找答案 题目来源 Problem - 1540 (hdu.edu.cn) #include<iostream> #include<algorithm> #include<stack> using namespace std; const int maxn = 1e6 + 10; struct 阅读全文
posted @ 2021-10-06 00:07 warmhearthhh 阅读(49) 评论(0) 推荐(0)
摘要: 线段树二分 Problem - 4553 (hdu.edu.cn) 用2个线段树分别维护男生预约的时间段和女生预约的时间段。 线段树里面保存的是最大连续子段和,空闲时间为1,预约了的话就是0。 当男生来预约的时候,只需要修改男生的线段树即可。 而当女生来预约的时候若在男生的线段树里面找不到空闲时间再 阅读全文
posted @ 2021-10-06 00:06 warmhearthhh 阅读(101) 评论(0) 推荐(0)
摘要: /* 题目描述 在 20162016 年,佳媛姐姐喜欢上了数字序列。因而她经常研究关于序列的一些奇奇怪怪的问题,现在她在研究一个难题,需要你来帮助她。 这个难题是这样子的:给出一个 1 到 n 的排列,现在对这个排列序列进行 m 次局部排序,排序分为两种: 0 l r 表示将区间 [l,r][l,r 阅读全文
posted @ 2021-10-06 00:01 warmhearthhh 阅读(51) 评论(0) 推荐(0)
摘要: 树上求和 https://ac.nowcoder.com/acm/problem/19428 #include<bits/stdc++.h> using namespace std; const int maxn=1e5+10; const int MOD=23333; #define ll lon 阅读全文
posted @ 2021-10-06 00:00 warmhearthhh 阅读(44) 评论(0) 推荐(0)