线切割空间,推出公式搞定 #include <iostream> using namespace std; int main() { long long n; cin >> n; cout << n * (n+1) / 2 + 1 << endl; return 0; }