04 2022 档案

摘要:The 2021 ICPC Asia Kunming Regional Contest D-Divisions 做法:我们发现,当构造成a a a b b b c c c $(a<b<c)$这样的时候,答案就是$2^{num(a)}-1+2^{num(b)}-1+2^{num(c)}-1+1$,我们 阅读全文
posted @ 2022-04-27 20:44 lmj_1 阅读(133) 评论(0) 推荐(0)
摘要:Educational Codeforces Round 127 (Rated for Div. 2) E. Preorder 题意:给一颗点权仅为AB的完全二叉树,可以对每个点的两个子树进行交换,求前序遍历共有多少种 做法:其实很好想,设dp[x],表示以x为子树的方案有多少种,那么假如两棵子树完 阅读全文
posted @ 2022-04-25 20:00 lmj_1 阅读(49) 评论(0) 推荐(0)
摘要:第十九届浙大城市学院程序设计竞赛 E Disjoint Path On Tree 题意:求树上不相交简单路径对的数量 做法:其实很容易想到,我们需要求f1[x]表示经过x点的子树内的简单路径数,f2[x]表示子树x的内的简单路径数量,但是统计数量的时候赛时我想的复杂了一些,因为还需要换根求一下各种值 阅读全文
posted @ 2022-04-12 13:08 lmj_1 阅读(109) 评论(0) 推荐(0)
摘要:矩阵hash 点击查看代码 #include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; const int maxn=1010; const ull seed1=131; const ull seed2= 阅读全文
posted @ 2022-04-04 14:42 lmj_1 阅读(47) 评论(0) 推荐(0)