摘要: jisoo 简单的二分 #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> using namespace std; int n,m; struct po{ int x; 阅读全文
posted @ 2021-09-18 21:49 Simex 阅读(38) 评论(0) 推荐(0) 编辑
摘要: jisoo 可以证明,一定只需要考虑需要翻转的边 如果一种合法方案,需要翻转不需要翻转的边,那么就必然有一个过程是把这条边翻转过来, 那么这一条边有两种可能,要不它连着偶数个由需要翻转的边组成的环,要不是有许多同样的此类不翻转边组成的环 对于以上两种可能,可以发现都会出现需要翻转的边连成环的可能。 阅读全文
posted @ 2021-09-18 21:47 Simex 阅读(72) 评论(0) 推荐(0) 编辑
摘要: jisoo 这是一个拓扑排序,对于一条路线,中间没有走过的节点,一定等级低于路线上经过的节点 然后就可以了 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #defin 阅读全文
posted @ 2021-09-18 21:40 Simex 阅读(46) 评论(0) 推荐(0) 编辑