为什么是sum*2-t*t呢?
#include<cmath>#include<cstdio>#include<cstring>usingnamespacestd;typedef longlong ll;intmain() {intq; scanf("%d", &q);while(q--) {intx; scanf("%d", &x);ll ans=0;intt=sqrt(x+1);for(inti=1; i<=t; ++i) ans+=(x/i);printf("%lld\n", ans*2-t*t);}return0;}
这里的这句没太看懂,求dalao指点一下