博主链接
for(int i=1,last;i<=n;i=last+1){ last=n/(n/i); //该区间的最后一个数 ans+=(last-i+1)*(n/i); }
暂无评论,快来抢首评~
相关推荐