P7540
一道简单的结论题。手玩几组数据得到所有的数对组数为
再一求和,发现答案就是
所以,对于这道题,我们只要
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
cout<<(n*(n+1)*(n+2)>>1)<<'\n';//右移一位相当于/2,但运行速度更快
return 0;
}