搬运题解Claris:1 n d v相当于给$a[x]+=v[\gcd(x,n)=d]$ $\begin{eqnarray*}&&v[\gcd(x,n)=d]\\&=&v[\gcd(\frac{x}{d},\frac{n}{d})=1]\\&=&v\sum_{k|\gcd(\frac{x}{d},\frac{n}{d})}\mu(k)\\&=&\sum_{k|\frac{n}{d},dk|x}v\mu(k)\end{eqnarray*}$设…
GCD Array Time Limit: 11000/5500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 843 Accepted Submission(s): 205 Problem Description Teacher Mai finds that many problems about arithmetic function can be reduced to…
1 n d v相当于给$a[x]+=v[\gcd(x,n)=d]$ \[\begin{eqnarray*}&&v[\gcd(x,n)=d]\\&=&v[\gcd(\frac{x}{d},\frac{n}{d})=1]\\&=&v\sum_{k|\gcd(\frac{x}{d},\frac{n}{d})}\mu(k)\\&=&\sum_{k|\frac{n}{d},dk|x}v\mu(k)\end{eqnarray*}\] 设$a[i]=\su…