|
+10
Here is another way to solve D. Let us call $$$f_x$$$ mean that is there $$$a_i$$$ is its factor.We can get the values in $$$\Theta(n\ln{n})$$$. And than we can get the answer: The last $$$\sum$$$ we can solve it in $$$\Theta(n\ln{n})$$$. So we can solve the problem in $$$\Theta(n\ln{n})$$$. record link:https://codeforces.me/contest/1884/submission/229180049. |