竞赛
考级
#include <bits/stdc++.h> using namespace std; long long n,ans,i,j; int main(){ cin>>n; for(i=1,j=1;i<=n;i++,j=(j2)%1000007) {n-=i;ans=(ans+ij)%1000007;} cout<<(ans+n*j)%1000007; return 0; }
Hackers-刘董---194