AT_abc139_d
结论
证明
因为我们知道
所以我们只需要将每个数向前移一位,这道题公式就变成了
#include <bits/stdc++.h>
using namespace std;
signed main() {
long long n;
scanf("%lld", &n);
printf("%lld", n * (n - 1) / 2);
return 0;
}
因为我们知道
所以我们只需要将每个数向前移一位,这道题公式就变成了
#include <bits/stdc++.h>
using namespace std;
signed main() {
long long n;
scanf("%lld", &n);
printf("%lld", n * (n - 1) / 2);
return 0;
}