摘要:
Ehab and the Expected GCD Problem 比较容易发现第一个元素所拥有的质因子个数最多,且往后的元素依次最多剔除1个质因子时最优。 最小的质因子就是2和3了,如果等于5,那么可以变成成 $2^2$ 更优,其他同理。 并且3的数量最多为1。 设第一个元素为 m=$2^x3^y 阅读全文
摘要:
##可持久化并查集 #include<cstdio> #include<iostream> using namespace std; const int MAXN=4e5+5; int n,m,rt[MAXN],fa[MAXN*20],cnt,kk,dep[MAXN*20]; struct ren{ 阅读全文
摘要:
###To The Moon #include<cstdio> #include<cstring> #include<iostream> using namespace std; #define ll long long const int MAXN=1e5+5; int n,m,cnt,rt[MA 阅读全文