摘要:
#include<bits/stdc++.h> #define getsize(p) (p?p->sz:0) using namespace std; typedef long long ll; const int N=2e5+10; struct node{ int l,r; int sz; no 阅读全文
摘要:
类似没有上司的舞会,找到环上一点,将环断开,强制是否选择root,做树形dp #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e6+1e5; int h[N],ne[N*2],e[N*2] 阅读全文
摘要:
本题是基环树模板题,但是有一点要注意,特判两元环是必要的 因为两元环中,我们要选权值大的两条边组成的直径,而多元环则不用在意,因为每两个点之间只有一条边 #include<bits/stdc++.h> using namespace std; typedef long long ll; const 阅读全文
摘要:
类比2019南昌区域赛c题,发现也是个二维数位dp,我们发现差值不可能超过+-1000,并且位数一共100位,因此可以列出状态方程 这题还需要考虑a<b,因此多枚举一位表示当前是否已经小于b #include<bits/stdc++.h> using namespace std; typedef l 阅读全文