版本比较
题解:CF1732E Location
正文
增加 1 行删除 1 行
27 行未改动282930313232333427 行未改动总时间复杂度为 $\mathcal{O}((n^{4/3}+nK+\cfrac{nB}{K}+\cfrac{n^2}{B})\log n)$。
取 $B=\mathcal{O}(n^{2/3}),K=\mathcal{O}(n^{1/3})$,总时间复杂度为 $\mathcal{O}(n^{4/3}\log n)$,空间复杂度为 $\mathcal{O}(n^{4/3})$。
当单次 $\gcd$ 做到 $\mathcal{O}(1)$ 时,时间复杂度应该为 $\mathcal{O}(n\sqrt{n^{2/3}\log n})$。当单次 $\gcd$ 做到 $\mathcal{O}(1)$ 时,时间复杂度应该为 $\mathcal{O}(n^{4/3}\log^{2/3} n)$。
较题解区其他人复杂度更优,不过可能有地方没分析到位。