正文
增加 5 行删除 5 行
12345678912 行未改动22232425262728293031323334353637388 行未改动呦吼吼~ 本蒟蒻又来写题解喽~~[题目传送门](https://www.luogu.com.cn/problem/P11871)### 简化题意求 $n$ 层数的每一个节点有多少条连线(可相交)### 解析别看有“树”这个字,就以为要用树的知识,实际上,本题是一个大水题!!12 行未改动```cpp#include<bits/stdc++.h>using namespace std;typedef long long ll;ll f(int n){if (n==1) return 0;ll ans=0;for(int i=1;i<n;i++) ans+=3*(2*i-1);ans+=(n-1);return ans;}int main(){ll t,n;cin>>t;while(t--)8 行未改动12345678912 行未改动22232425262728293031323334353637388 行未改动呦吼吼~ 本蒟蒻又来写题解喽~~[题目传送门](https://www.luogu.com.cn/problem/P11871)### 简化题意求 $n$ 层数的每一个节点有多少条连线(可相交)### 解析别看有“树”这个字,就以为要用树的知识,实际上,本题是一个大水题!!12 行未改动```cpp#include<bits/stdc++.h>using namespace std;typedef long long ll;ll f(int n){if (n==1) return 0;ll ans=0;for(int i=1;i<n;i++) ans+=3*(2*i-1);ans+=(n-1);return ans;}int main(){ll t,n;cin>>t;while(t--)8 行未改动