c140. 計算前n項和
Tags :
Accepted rate : 4人/4人 ( 100% ) [非即時]
評分方式:
Tolerant

最近更新 : 2025-04-30 13:09

Content

數列f(n)=n2+4n+2,S(n)=f(1)+f(2)+f(3)+⋯+f(n)。輸入一個數字n,計算S(n)的值。

Input

輸入一個正整數n(1<n<20)。

Output

輸出S(n)的值

Sample Input #1
1
Sample Output #1
7
Sample Input #2
3
Sample Output #2
44
Sample Input #3
10
Sample Output #3
625
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (33%): 0.1s , <1K
公開 測資點#1 (33%): 0.1s , <1K
公開 測資點#2 (34%): 0.1s , <1K
Hint :
Tags:
出處:
[管理者: stu210106(lin) ]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」