摘要:
题面 https://www.luogu.org/problem/P2518 题解 按位数从大到小填数,每次考虑比当前数字小的情况,然后用可重集排列算方案加起来就可以了。 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3200 题解 从小到大给“奇”和“偶”的序列加数。奇的序列的长度不能超过偶的序列的长度,把加入偶序列记做写一个$($,加入奇序列记做写一个$)$,就是一个括号序列问题,所以答案是一个卡特兰数。 要求输出第$n$个卡特兰数的值膜$p 阅读全文
摘要:
题面 https://www.luogu.org/problem/P2606 题解 数列按广度优先搜索序搜索,变成一个堆。所以形态是给定的。 只需记忆化搜索就可以了,复杂度$O(logn)$。顺序递推亦可。 对于阶乘超过$p$的情况,我们把$p$的次幂记下来,算的时候直接减去。$aysn$说这是卢卡 阅读全文
摘要:
题面 https://www.luogu.org/problem/P4609 题解:首先注意到整个“建筑群”被最高的建筑分成两部分,两部分相对独立。 把第一类斯特林数的环变成强制以最大值为头的序列,这样一个盒子代表了一个楼房和被它遮盖的楼房的集合。 所以只要有$a+b-2$个这样的集合,然后把其中的 阅读全文
摘要:
题面 https://www.luogu.org/problem/P2992 题解 如果一个三元点集构成黄金三角形,则他们对原点的夹角加起来为$2\pi$, 所以考虑补集转换,不构成黄金三角形的三元点集,可以画一条过原点的直线,使他们都在直线一边。 枚举直线,双指针。 注意这题$atan2(y,x) 阅读全文
摘要:
做题状态很迷啊。 题面 https://www.luogu.org/problem/P3223 题解 本来想的是$$ans=A_{n}^{n} A_{n+1}^{m} A_{n+m+1}^{2}$$,先男生、后女生、最后老师,后来发现假了,因为可以两个女生一开始相邻,但是后来老师插进去把他们分离了。 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3197 题解 以一道水题作为“数学”部分的开端。 补集转换$+$快速幂 阅读全文
摘要:
题面 https://www.luogu.org/problem/P5008 题解 为了带入氛围还把$QQ$音乐里的《锦鲤抄》点开听了听。 让我们想想删除的顺序是什么样子的:最优的顺序一定是从拓扑序最大的点倒着删,删到拓扑序最小的点。 其中有入度的强连通分量可以全都删完(最后通过“入度”退回拓扑序小 阅读全文
摘要:
题面 https://www.luogu.org/problem/P5234 题解 首先先求割边,割掉的肯定是一条割边。 又因为敌人会加固一条链,所以这条链上的边肯定不能割,我们只需要按权值从小到大加入每一条割边,然后看看敌人什么时候兼顾不上就行了。 判断加入的边是否在已经确定的链上,本来应该无根树 阅读全文
摘要:
题面 https://www.luogu.org/problem/P4494 题解 $2018$蛤省省选神仙题。 前置知识:线性基。$orz\ aysn$ 关键的一个结论:在一个任意的联通块内,如果它的黑点个数为偶数个,则“联通块内的目标”是可以达到的。设点数为$n$,边数为$m$,则方案数为$2^ 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3812 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3687 题解 如果原图不是仙人掌(在这里,我们认为一棵树也是一个仙人掌),则无解,输出$0$。 如果原图是一个仙人掌,加的边是不能跨越仙人掌上的环边的(若跨越,则仙人掌上的环边被$2$个环所有,不是仙人掌),所以我们直接把环边断掉 阅读全文
摘要:
题面 https://www.luogu.org/problem/P1273 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P1081 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/CF1031D 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P1987 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P1993 题解 那一天好像收到了我女神的$qq$信息呢,女神鼓励我辽~~~ 阅读全文
摘要:
题面 https://www.luogu.org/problem/P5022 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3385 题解 $bfs-spfa$ 阅读全文
摘要:
题面 https://www.luogu.org/problem/P2149 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P5018 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P5017 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3387 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3388 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P2341 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P1637 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3384 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P4568 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3369 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P1144 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P1462 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3959 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P1120 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3919 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3834 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3157 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P3584 题解 阅读全文
摘要:
题面 https://www.luogu.org/problem/P4643 题解 阅读全文