Codeforces Round #553 (Div. 2) E
考虑每条边的贡献#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=1e5+5;ll a[maxn],n;ll ans;int main(int argc, char const *argv[]){ cin>>n; for(int i=1...