现在的位置: 首页 > 综合 > 正文

hdoj 1290

2019年07月31日 ⁄ 综合 ⁄ 共 179字 ⁄ 字号 评论关闭

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;
}

 

【上篇】
【下篇】

抱歉!评论已关闭.