QOJ.ac

QOJ

Type: Editorial

Status: Open

Posted by: jiangly

Posted at: 2025-12-12 23:42:39

Last updated: 2025-12-12 23:42:45

Back to Problem

题解

可以写成 $f(0)=0,f(n)=1+\sum_{k=2}^{20210926}f(\lfloor n/k\rfloor)$,整除分块递归求解,时间复杂度 $O(n^{3/4})$。

也可以考虑式子的含义,也就是若干个 $2$ 到 $20210926$ 的整数相乘不超过 $n$ 的方案数。忽略上界的话就很简单,而由于上界很大,只需要枚举容斥一下,容易做到 $O(n^{2/3+\epsilon})$。

Comments

No comments yet.