[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…
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…
一眼二分.然后重点是树上贪心部分 长得像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]…
POI2011题解 2214先咕一会... [BZOJ2212][POI2011]Tree Rotations 线段树合并模板题. #include<cstdio> #include<algorithm> using namespace std; int gi(){ int x=0,w=1;char ch=getchar(); while ((ch<'0'||ch>'9')&&ch!='-') ch=getchar(); if (ch=='-') w=0…