Atcoder ABC 139D
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 \n",ans);
//system("pause");
return 0;
}
有些路你和某人一起走,就长得离谱,你和另外一些人走,就短得让人舍不得迈开脚步。