首页 > 2019
头像 shyyhs
发表于 2020-12-03 22:00:18
之前用树形dp写的,这次用点分治写一下,不解释~ #include <bits/stdc++.h> using namespace std; const int N=2e4+500; const int mod=2019; struct Tree{ int to,val; }; 展开全文
头像 shyyhs
发表于 2020-09-18 11:40:10
一个计数问题,下次看到数据就直接dp吧.有点分治思想在里面.就是一个点一个点的计数,一条链一条链的来,f[i][j]表示到了i这个点值为j的方案数...如此转移下就好了. #include <bits/stdc++.h> using namespace std; const int N= 展开全文