2023年4月1日
摘要: 对分数取模,对B求逆元 (费马小定理实现) #define int long long const int mod =1e9+7; int ksm(int x,int y){ if(y==0) return 1; int t= ksm(x,y/2) ; if(y&1) return ((t*t%mo 阅读全文
posted @ 2023-04-01 22:38 towboat 阅读(39) 评论(0) 推荐(0)
摘要: 换根dp, father -> son , 基本是加减 #include <bits/stdc++.h> using namespace std ; const int N=1e5+2,M=N*5; #define int long long int n,a[N],sz[N],g[N],f[N],S 阅读全文
posted @ 2023-04-01 17:31 towboat 阅读(18) 评论(0) 推荐(0)