← ~/試題
P2016

Triangular Number

Easy
// 描述
Output the sum 1 + 2 + ... + n.
// 輸入格式
A single integer n (1 <= n <= 10^9).
// 輸出格式
The value of n(n+1)/2.
// 提示
Use the closed-form formula; mind 64-bit overflow.
// 樣例
輸入樣例
10
輸出樣例
55
// 題目資訊
難度Easy
通過率70%
時間限制1000 ms
記憶體限制65536 KB
通過7