Atcoder ABC 139D
解法:
等差数列求和公式,记得开 $ long long $
CODE:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define LL long long
LL n,ans;
int main() {
scanf("%lld",&n);
ans = n * (n - 1) / 2;
printf("%lld
",ans);
//system("pause");
return 0;
}