摘要: Same GCDs "link" Solution $$ gcd(a,m)=gcd(a+x,m)\ \ (0 define LL long long using namespace std; LL t,a,m; LL phi(LL x) { LL ret=x; for(LL i=2;i1)ret=r 阅读全文
posted @ 2020-02-23 11:15 liqgnonqfu 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Cow and Fields "link" Solution 分别从1、n广搜,可以得到每个点在广搜树中的层数:d[i],dn[i],考虑加一条边(x,y),则新出现的路中,可能为最短路的是:min(d[x]+dn[y] 1,d[y]+dn[x] 1)。 又由$d[x]+dn[y] 1 using 阅读全文
posted @ 2020-02-23 11:13 liqgnonqfu 阅读(135) 评论(0) 推荐(0) 编辑