摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3995线段树维护连通性。我们发现,对于一个区间[L,R],我们只需要知道(1,L),(2,L),(1,R)和(2,R)这4个点的之间的连通情况即可。我们在线段树中,假设当前节点的表示的区间的为[L,R]... 阅读全文
posted @ 2015-09-23 16:45 maijing 阅读(728) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3993裸题。二分后强行网络流。#include#include#include#include#include#include#include#include#include#include#inclu... 阅读全文
posted @ 2015-09-23 16:27 maijing 阅读(177) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3994好吧表示完全不会。建议先看一下Codeforces235E。不妨设$a\leq b$$\sum\limits_{i=1}^{a}\sum\limits_{j=1}^{b}d(ij)$$=\sum\... 阅读全文
posted @ 2015-09-23 16:21 maijing 阅读(301) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/235/problem/E远距离orz......rng_58证明可以见这里(可能要FQ才能看到)还是copy一下证明吧:记$$f(a,b,c)=\sum\limits_{i=1}^{a}\sum\limits_{j=1}^{b}\sum\... 阅读全文
posted @ 2015-09-23 16:02 maijing 阅读(581) 评论(0) 推荐(0) 编辑