http://acm.hdu.edu.cn/showproblem.php?pid=1290
/*
简单题
F[n] = F[n-1] + f[n-1]
*/
#include <iostream> using namespace std; int main() { int n; while (cin >> n) { cout << (n-1+(n*n-1)*n/6+2) << endl; } return 0; }
http://acm.hdu.edu.cn/showproblem.php?pid=1290
/*
简单题
F[n] = F[n-1] + f[n-1]
*/
#include <iostream> using namespace std; int main() { int n; while (cin >> n) { cout << (n-1+(n*n-1)*n/6+2) << endl; } return 0; }