https://www.luogu.org/blog/user50971/solution-p5401 #include<cstdio> #include<algorithm> #define rep(i,l,r) for (int i=(l); i<=(r); i++) using namespace std; ,mod=,i2=; int D,n,m,ans,fac[N],inv[N],ip2[N],f[N],g[N],rev[N],a[N],b[N]; int ksm(…
描述 There are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, ..., N. Your task is to find the bead whose weight is median (the ((N+1)/2)th among all beads). The following com…