[POI2011]Śmieci】的更多相关文章

[POI2011]Śmieci 题目大意: 一个\(n(n\le10^5)\)个点\(m(m\le10^6)\)条边的无向图,每条边有边权\(0/1\),试找出若干个环,使得每次翻转环上所有边的权值,使得最后所有边权都是\(0\). 思路: 权值为\(0\)的边都没有用,因为若方案存在,一定存在一种方案使得所有环只经过\(1\)边. 因此我们只留下\(1\)边,暴力DFS找环即可.注意要加上当前弧优化. 源代码: #include<stack> #include<cstdio> #…
补一发题解.. 整体二分这个东西,一开始感觉复杂度不是很靠谱的样子 问了po姐姐,说套主定理硬干.. #include<bits/stdc++.h> #define ll long long #define inf 1e9 #define N 300005 using namespace std; inline int read(){ ,f=;char ch=getchar(); ;ch=getchar();} *x+ch-';ch=getchar();} return x*f; } int…
2276: [Poi2011]Temperature Time Limit: 20 Sec  Memory Limit: 32 MBSubmit: 293  Solved: 117[Submit][Status] Description The Byteotian Institute of Meteorology (BIM) measures the air temperature daily. The measurement is done automatically, and its res…
2213: [Poi2011]Difference Time Limit: 10 Sec  Memory Limit: 32 MBSubmit: 343  Solved: 108[Submit][Status] Description A word consisting of lower-case letters of the English alphabet ('a'-'z') is given. We would like to choose a non-empty contiguous (…
2212: [Poi2011]Tree Rotations Time Limit: 20 Sec  Memory Limit: 259 MBSubmit: 391  Solved: 127[Submit][Status] Description Byteasar the gardener is growing a rare tree called Rotatus Informatikus. It has some interesting features: The tree consists o…
线段树的合并..对于一个点x, 我们只需考虑是否需要交换左右儿子, 递归处理左右儿子. #include<bits/stdc++.h> using namespace std; #define M(l, r) (((l) + (r)) >> 1) typedef long long ll; ; ; struct Node *null, *pt; struct Node { Node *l, *r; int cnt; Node() : cnt() { l = r = null; }…
2217: [Poi2011]Lollipop Time Limit: 15 Sec  Memory Limit: 64 MBSec  Special JudgeSubmit: 383  Solved: 159[Submit][Status][Discuss] Description 有一个长度为n的序列a1,a2,...,an.其中ai要么是1("W"),要么是2("T"). 现在有m个询问,每个询问是询问有没有一个连续的子序列,满足其和为q. Input 第一行…
BZOJ_2529_[Poi2011]Sticks_贪心 Description Little Johnny was given a birthday present by his grandparents. This present is a box of sticks of various lengths and colours. Johnny wonders if there are three sticks in the set he has been given that would…
BZOJ_2212_[Poi2011]Tree Rotations_线段树合并 Description Byteasar the gardener is growing a rare tree called Rotatus Informatikus. It has some interesting features: The tree consists of straight branches, bifurcations and leaves. The trunk stemming from t…
BZOJ_2527_[Poi2011]Meteors_整体二分 Description Byteotian Interstellar Union (BIU) has recently discovered a new planet in a nearby galaxy. The planet is unsuitable for colonisation due to strange meteor showers, which on the other hand make it an except…