摘要:
对每一个宗教建一棵线段树,然后树剖搞搞 cpp include include using namespace std; int n, m, w[100005], c[100005], uu, vv, hea[100005], cnt, dep[100005]; int fa[100005], to 阅读全文
摘要:
树状数组不用动脑子真爽啊 cpp include include include using namespace std; typedef long long ll; int m, n, b[100005], rem, rot[100005], lson[20000005], rson[200000 阅读全文
摘要:
前置技能:Count on a tree 然后带上一个启发式合并 cpp include include include using namespace std; int n, m, orz, uu, vv, ww, a[80005], b[80005], rnk[80005], rem, cnt, 阅读全文
摘要:
设dp[i][j][k]表示前i个数中选j个并且因子含有k个2的能获得的最多的5的个数 则dp[i][j][k]=max(dp[i 1][j][k],dp[i 1][j 1][k cnt2]+cnt5) 滚掉一维 cpp include include include using namespace 阅读全文
摘要:
先算出一个点前头比它大和后头比它小的数量。 每次删点就扔进一个主席树里头,防止造成重复删答案。 cpp include include include using namespace std; int n, m, a[100005], p[100005], c[100005], uu, pre[10 阅读全文
摘要:
主席树放到树上而已 cpp include include include using namespace std; int n, m, lstans, uu, vv, a[100005], b[100005], rnk[100005], rem, cnt; int lson[2200005], r 阅读全文