摘要: 传送门:http://bailian.openjudge.cn/practice/4091 【题解】 这垃圾题还卡常??? 首先我们发现暴力做是O(nqlogn)的,这个logn是log5000大概12 我们发现可以把它优化到O(nqm)的,m=10,然后就过了。 可能数据不满吧。。 # inclu 阅读全文
posted @ 2017-05-17 09:15 Galaxies 阅读(303) 评论(0) 推荐(0)
摘要: 传送门:http://bailian.openjudge.cn/practice/4090/ 【题解】 垃圾题目暴力能过??? splay,那个revolve相当于交换区间,瞎搞搞。 就这垃圾题目还tm卡常真是没话说了 加一坨rg和st,把回收队列改成自己写的栈就过了。。 6s-》4s pkusc如 阅读全文
posted @ 2017-05-17 00:04 Galaxies 阅读(308) 评论(0) 推荐(0)
摘要: 传送门:http://bailian.openjudge.cn/practice/2868/ 【题解】 牛顿迭代:x[n+1] = x[n] - f(x[n])/f'(x[n]) 这样迭代下去就能求f(x)的零点了。 对于本题只需要乱搞就行了。 # include <math.h> # includ 阅读全文
posted @ 2017-05-16 22:08 Galaxies 阅读(230) 评论(0) 推荐(0)
摘要: 传送门:http://bailian.openjudge.cn/practice/2812/ 【题解】 垃圾题目毁我青春。 暴力枚举两个点,判断是否成立。 瞎jb判一判,剪剪枝就过了。 大概就是排序后如果当前x+dx已经大于n了就break (听说会快很多(并没有)) 我怎么这么傻逼啊:反正只有一条 阅读全文
posted @ 2017-05-16 21:43 Galaxies 阅读(436) 评论(1) 推荐(0)
摘要: 传送门:http://bailian.openjudge.cn/practice/2805/ 【题解】 n不大,枚举两个端点,推算出剩下两个,拿map或哈希看看有多少即可。 # include <map> # include <stdio.h> # include <string.h> # incl 阅读全文
posted @ 2017-05-16 20:55 Galaxies 阅读(272) 评论(0) 推荐(0)
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1856 【题解】 考虑将操作看成走(1, -1)和(1, 1),那么就是从(0, 0)走到(n+m, n-m)。 那么有x+y=n+m,x-y=n-m,那么x=n, y=m。 那么方案数为C(n 阅读全文
posted @ 2017-05-16 11:51 Galaxies 阅读(203) 评论(0) 推荐(0)
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2096 【题解】 单调队列。维护上升&下降 # include <stdio.h> # include <string.h> # include <iostream> # include <al 阅读全文
posted @ 2017-05-16 11:05 Galaxies 阅读(172) 评论(0) 推荐(0)
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3382 【题解】 套路题。 首先我们会发现曼哈顿距离不好处理,难道要写kdtree??? (kdtree真的可以写啊qwq) 曼哈顿距离转成切比雪夫距离。 (x,y) ==> (x+y, x-y 阅读全文
posted @ 2017-05-16 10:47 Galaxies 阅读(221) 评论(0) 推荐(0)
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1055 【题解】 简单区间dp。 f[l,r,c]表示[l,r]是否能表示成c。 # include <stdio.h> # include <string.h> # include <iost 阅读全文
posted @ 2017-05-16 10:40 Galaxies 阅读(287) 评论(0) 推荐(0)
摘要: CTSC游记 day 0 到达帝都。 复习板子 day 1 第一题傻逼题啊 第二题第三题写个暴力 好了120稳了 出来一看第一题基数排序炸了? 51+10+10崩盘 day 2 答辩有意思啊 王选怎么第二季了啊 颓颓颓 day 3 第一题傻逼题啊 后两题暴力啊 135稳了 出来一看第三题暴力炸了?第 阅读全文
posted @ 2017-05-07 21:45 Galaxies 阅读(204) 评论(0) 推荐(0)