Live2d Test Env

随笔分类 -  离线操作---cdq分治 && 整体二分

摘要:题意:现在给定空空的三维平面,有加点操作和询问立方体点数。 思路:考虑CDQ套CDQ。复杂度是O(NlogN*logN*logN),可以过此题。 具体的,这是一个四维偏序问题,4维分别是(times,x,y,z);我们知道cdq可以求出t<=T,x=X,y<=Y,在套一层就可以z<=Z了。那么一个立 阅读全文
posted @ 2019-09-13 09:05 nimphy 阅读(299) 评论(0) 推荐(0) 编辑
摘要:题意:询问区间有多少个连续的段,而且这段的颜色在[L,R]才算贡献,每段贡献是1。 有单点修改和区间查询。 思路:46min交了第一发树套树,T了。 稍加优化多交几次就过了。 不难想到,除了L这个点,其他的点都可以只统计这一段的段首。把位置看成x,颜色看成y,就成了二维平面就矩形内点的个数,这就是裸 阅读全文
posted @ 2019-09-12 10:58 nimphy 阅读(338) 评论(3) 推荐(0) 编辑
摘要:A .Assigning Workstations 题意:给定N个人的工作时间和工作时长,我们可以假设有无数台工作机器,如果一台机器超过M时间未使用就会关闭,那么我们怎么安排机器的使用,使得需要开启机器的次数最少。 思路:贪心,维护一个时间队列q,维护一个单调队列q1; 前者表示没有使用了但还没关闭 阅读全文
posted @ 2019-03-13 19:30 nimphy 阅读(554) 评论(0) 推荐(0) 编辑
摘要:3295: [Cqoi2011]动态逆序对 Description 对于序列A,它的逆序对数定义为满足i<j,且Ai>Aj的数对(i,j)的个数。给1到n的一个排列,按照某种顺序依次删 除m个元素,你的任务是在每次删除一个元素之前统计整个序列的逆序对数 对于序列A,它的逆序对数定义为满足i<j,且A 阅读全文
posted @ 2018-11-21 15:28 nimphy 阅读(177) 评论(0) 推荐(0) 编辑
摘要:题意:给定N个组合,每个组合有a和b,现在求最长序列,满足a不升,b不降。 思路:三位偏序,CDQ分治。 但是没想到怎么输出最小字典序,我好菜啊。 最小字典序: 我们倒序CDQ分治,ans[i]表示倒序的以i为结尾的最长序列,如果当前的ans[i]==目前最大,而且满足序列要求,就输出。 阅读全文
posted @ 2018-11-05 23:07 nimphy 阅读(272) 评论(0) 推荐(0) 编辑
摘要:Do you like painting? Little D doesn't like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy pa 阅读全文
posted @ 2018-10-19 20:05 nimphy 阅读(349) 评论(0) 推荐(0) 编辑
摘要:Perhaps the sea‘s definition of a shell is the pearl. However, in my view, a shell necklace with n beautiful shells contains the most sincere feeling 阅读全文
posted @ 2018-09-17 15:58 nimphy 阅读(208) 评论(0) 推荐(0) 编辑
摘要:In the lattice points of the coordinate line there are n radio stations, the i-th of which is described by three integers: xi — the coordinate of the  阅读全文
posted @ 2018-05-31 16:54 nimphy 阅读(291) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/OYzx/p/5506468.html BZOJ2863:(允许离线) 题目大意:给定一个n*n的矩形,以及若干个操作,操作有如下两种: 1.给矩形的(x,y)加上一个v; 2.询问某个子矩阵的权值和。 数据范围:n<=5*10^5,操作数<=2*10 阅读全文
posted @ 2018-05-31 11:45 nimphy 阅读(163) 评论(0) 推荐(0) 编辑
摘要:更多Bitset的运用,请看这里http://www.cnblogs.com/hua-dong/p/8519739.html。 由于在学cdq分治,看到了这道题。先来看一道题目 (hihocoder1513): 问题:给出每个人(n<=100000)的五门学科成绩,求出所有人:五门学科名次都比自己靠 阅读全文
posted @ 2018-01-06 11:23 nimphy 阅读(1264) 评论(6) 推荐(1) 编辑
摘要:Byteotian Interstellar Union (BIU) has recently discovered a new planet in a nearby galaxy. The planet is unsuitable for colonisation due to strange m 阅读全文
posted @ 2018-01-04 17:58 nimphy 阅读(304) 评论(0) 推荐(0) 编辑
摘要:Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares fo 阅读全文
posted @ 2018-01-03 21:30 nimphy 阅读(437) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示