给你一个图和三个点U,V,W  问你是否存在从U到V和从U到W的两条边不相交路径 先边双缩点 再每个连通分量搞LCA 最后LCA判 #include<bits/stdc++.h> using namespace std; #define INF 0xfffffff #define maxn 200025 #define min(a,b) (a<b?a:b) int m, n, Time, cnt, top; int dfn[maxn], block[maxn], low[maxn], F…
在这个物欲横流的社会 oj冷漠无情 只有这xx还有些温度 越界就越界吧  wrong 怎么回事.... 给出一个图 然后给出q次询问 问是否存在v和w分别到u的路径且边不重复 在边双连通分量中 任意两点 都至少存在两条边不重复的路径 那么若u  v w 在同一连通图中 则存在 若不在 则只有u在 v 和 w 中间时才存在 想一想是不是 #include <iostream> #include <cstdio> #include <sstream> #include &l…
辣鸡错误:把dfs和ldfs搞混...QAQ 题意:给定一个无向图,然后查询q次,求每次查询就在图上增加一条边,求剩余割边的个数. 先把边双缩点,然后预处理出LCA的倍增数组: 然后加边时,从u往上跳,把所有u到LCA(u,v)路径上割边去掉,即 --ans:v同理: 而向上跳的时候可以用并查集,把已经去掉的边,用路径压缩忽略掉,会往上跳的更快些. memset记得写全,不然.. #include<cstdio> #include<iostream> #include<cma…
题目链接: H - Rescue the Princess  ZOJ - 4097 学习链接: zoj4097 Rescue the Princess无向图缩点有重边+lca - lhc..._博客园 题目大意: 首先是T组测试样例,然后是n个点,m条双向边.然后给你u,v,w.问你v和w是否能够到达u,两个人走过的边不能有重复,否则这条边会被压塌. 具体思路:首先对能形成连通块的进行缩点,构成一个个的连通图.然后这样整个图就变成了一个森林,然后再根据染色后的连通块重新建图. 对于每一次的询问,…
Princess Cjb is caught by Heltion again! Her knights Little Sub and Little Potato are going to Heltion Kingdom to rescue her. Heltion Kingdom is composed of nn islands, numbered from 11 to nn. There are mm bridges in the kingdom, among which the ii-t…
Rescue The Princess Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry the princess set out immedia…
Rescue The Princess Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 412  Solved: 168 [Submit][Status][Web Board] Description Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince wh…
题目传送门 /* 已知一向量为(x , y) 则将它旋转θ后的坐标为(x*cosθ- y * sinθ , y*cosθ + x * sinθ) 应用到本题,x变为(xb - xa), y变为(yb - ya)相对A点的位置,即B绕着A点旋转60度至C点 注意:计算后加回A点的坐标才是相对于原点的坐标 详细解释:http://www.tuicool.com/articles/FnEZJb */ #include <cstdio> #include <cmath> #include…
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2603 Rescue The Princess Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Several days ago, a beast caught a beautiful princess and the princess was put in prison. To re…
Rescue The Princess Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry the princess set out immedia…