整除分块

for(int l=1,r;l<=n;l=r+1)
{
    r=n/(n/l);
    ans+=(r-l+1)*(n/l);
}
posted @ 2020-02-03 22:51  Zeronera  阅读(105)  评论(0)    收藏  举报