2525: [Poi2011]Dynamite Time Limit: 30 Sec Memory Limit: 128 MBSubmit: 240 Solved: 120[Submit][Status][Discuss] Description The Byteotian Cave is composed of n chambers and n-1 corridors that connect them. For every pair of chambers there is uniqu…
[Poi2011]Dynamite Time Limit: 30 Sec Memory Limit: 128 MBSubmit: 270 Solved: 138[Submit][Status][Discuss] Description The Byteotian Cave is composed of n chambers and n-1 corridors that connect them. For every pair of chambers there is unique way…
一眼二分.然后重点是树上贪心部分 长得像dp一样,设mn为子树内已炸点的最浅点,mx为子树内没有炸并且需要炸的最深点,然后转移直接从子树继承即可 然后是判断当前u点是否需要炸,当mx[u]+mn[u]<=mid,当前子树可以自己消化,所以mx[u]=-inf:否则,就需要在u炸一下 #include<iostream> #include<cstdio> using namespace std; const int N=300005; int n,m,h[N],cnt,d[N]…
BZOJ 2530 Poi2011 Party Description Byteasar intends to throw up a party. Naturally, he would like it to be a success. Furthermore, Byteasar is quite certain that to make it so it suffices if all invited guests know each other. He is currently trying…