[CF1045C]Hyperspace Highways】的更多相关文章

题目大意:给一张$n$个点$m$条边的图,保证若有一个环,一定是完全子图,多次询问两个点之间的最短路径长度 题解:把完全子图缩成一个点,圆方树,方点权值设成$1$,圆点设成$0$即可. 卡点:数组开小 C++ Code: #include <cstdio> #include <algorithm> #define maxn 100010 #define maxm 500010 inline int min(int a, int b) {return a < b ? a : b…
学了一下圆方树, 好神奇的东西呀. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pair<LL, int> #define PII pair<int, int> #define SZ(x) ((int)x.size()) #def…
比赛的时候开G开了3h结果rose说一句那唯一一个AC的是羊的心态就崩了.. 这套题感觉质量挺好然后就back了下 A: AI robots 有三个限制条件:相互能够看见和智商的差.使用主席树,可以维护两个状态,分别是其中一个“看见”和“智商”,这样的做法就无法利用K<=20的条件了. 利用扫描线+线段树,可以解决相互看见的约束(大概是我做过最神的扫描线了)对于一个点,处理出它能够看见的最前和最后点,和它的位置一起当做一条线,最前点加入这个点的位置,最后点删除这个点的影响,点的位置的线相当于一个…
Bubble Cup 11 - Finals [Online Mirror, Div. 1] 一场很好玩的题啊! I. Palindrome Pairs 枚举哪种字符出现奇数次. G. AI robots 对\(r\)从大到小排序,然后cdq分治. 注意要对\(q-k,q+k,q\)进行离散化 B. Space Isaac 对原序列做差分,b[i]=a[i]-a[i-1] 如果我们要凑出\(x\),那么集合A中小于\(x\)的数字,要关于\(x/2\)对称,大于\(x\)的数字要关于\((x+m…
总时间限制: 1000ms 内存限制: 65536kB描述The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. They're planning to build some h…
Highways Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 23421   Accepted: 10826 Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Fl…
Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. They're planning to build some highways so that i…
Hyperspace Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1023    Accepted Submission(s): 492 Problem Description The great Mr.Smith has invented a hyperspace particle generator. The device i…
点击打开链接 Highways Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19004   Accepted: 8815 Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia.…
题目连接 http://poj.org/problem?id=2485 Highways Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. They…