1 条题解
-
0
由于三元组 和 一一对应,故所有数字的平均值是:
而总的三元组数量是:
故答案为:
$$\dbinom{n+2}{3} \times 3 \times \dfrac{n+1}{2}=\dfrac{(n+1)^2(n+2)n}{4} $$#include <bits/stdc++.h> const int P = 1e9 + 7; using namespace std; int main() { int n; cin >> n; cout << 1ll * n * (n + 1) % P * (n + 2) % P * (n + 1) % P * (P + 1) / 4 % P << endl; return 0; }
信息
- ID
- 125
- 时间
- 100ms
- 内存
- 8MiB
- 难度
- 2
- 标签
- 递交数
- 2
- 已通过
- 2
- 上传者