A - Problem A.Alkane 留坑. B - Problem B. Beads 留坑. C - Problem C. Calculate 留坑. D - Problem D. Permutation 留坑. E - Problem E. TeaTree 题意:每个点会存下任意两个以他为LCA的点对的GCD,求每个点存的GCD的最大值 思路:DSU on tree  用 set 维护子树中的因子,对于重儿子不要处理多次 每次查找的时候,枚举轻儿子中的因子 还有一种线段树合并的写法 #i…
Practice Link J. Rikka with Nickname 题意: 给出\(n\)个字符串,要求依次合并两个串\(s, t\),满足将\(t\)合并到\(s\)中变成\(r\),使得\(s\)是\(r\)的前缀,并且\(t\)是\(r\)的一个子序列. 思路: 动态维护序列自动机,贪心插入即可. 代码: #include <bits/stdc++.h> using namespace std; #define N 1000010 char s[N], res[N]; int nx…
solved 7/11 2016 Multi-University Training Contest 10 题解链接 分类讨论 1001 Median(BH) 题意: 有长度为n排好序的序列,给两段子序列[l1,r1],[l2,r2]构成新的序列,问中间的数字. 思路: 根据不同情况分类讨论即可.时间复杂度O(1). 代码: #include <bits/stdc++.h> const int N = 1e5 + 5; int a[N]; int n, m; int l1, r1, l2, r…
CRB and Tree                                                             Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)                                                                                            To…
CRB and Apple Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 421    Accepted Submission(s): 131 Problem Description In Codeland there are many apple trees.One day CRB and his girlfriend decide…
CRB and Queries Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 533    Accepted Submission(s): 125 Problem DescriptionThere are N boys in CodeLand.Boy i has his coding skill Ai.CRB wants to k…
Welcome Party Time Limit: 4000/4000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 875    Accepted Submission(s): 194 Problem Description The annual welcome party of the Department of Computer Science and Technolo…
2015 Multi-University Training Contest 10 5406 CRB and Apple 1.排序之后费用流 spfa用stack才能过 //#pragma GCC optimize("O3") //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<bits/stdc++.h> using namespace std; function<…
A - Always Online Unsolved. B - Beautiful Now Solved. 题意: 给出一个n, k  每次可以将n这个数字上的某两位交换,最多交换k次,求交换后的最大和最小值 思路: 很明显有一种思路,对于最小值,尽可能把小的放前面, 对于最大值,尽可能把打的放前面.但是如果有多个最小数字或者最大数字会无法得出放哪个好,因此BFS一下即可 #include<bits/stdc++.h> using namespace std; const int INF =…
A - Maximum Multiple 题意:给出一个n 找x, y, z 使得$n = x + y +z$ 并且 $n \equiv 0 \pmod x, n \equiv 0 \pmod y, n \equiv 0 \pmod z$ 并且使得 $x \cdot y \cdot z$ 最大 思路:设$a = \frac{n}{x}, b = \frac{n}{y}, c = \frac{n}{z}$ 那么 $\frac{1}{a} + \frac{1}{b} + \frac{1}{c} =…