正文
增加 5 行删除 5 行
71 行未改动7273747576777879808182838470 行未改动1551561571581591601611621635 行未改动1691701711721731741751761773 行未改动71 行未改动// Contest: Luogu// URL: https://www.luogu.com.cn/problem/P5327// Memory Limit: 500 MB// Time Limit: 3000 ms//// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>#define pb push_backusing namespace std;bool ST;const int N = 1e5 + 5;70 行未改动bool ED;signed main(){ios_base::sync_with_stdio(false); cin.tie(0);mt19937 rnd(time(0));cin >> n >> q;for (int i = 1,u,v;i < n;++i){cin >> u >> v;g[u].pb(v);5 行未改动cin >> s >> t;add(s,t,dfn[s]);add(s,t,dfn[t]);}solve(1);cout << ans / 2 << '\n';cerr << "time used: " << 1.0 * clock() / CLOCKS_PER_SEC * 1000 << "ms\n";cerr << "memory used: " << abs(&ST - &ED) / 1024.0 / 1024.0 << " MB\n";return 0;}3 行未改动71 行未改动7273747576777879808182838470 行未改动1551561571581591601611621635 行未改动1691701711721731741751761773 行未改动71 行未改动// Contest: Luogu// URL: https://www.luogu.com.cn/problem/P5327// Memory Limit: 500 MB// Time Limit: 3000 ms//// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>#define pb push_backusing namespace std;bool ST;const int N = 1e5 + 5;70 行未改动bool ED;signed main(){ios_base::sync_with_stdio(false); cin.tie(0);mt19937 rnd(time(0));cin >> n >> q;for (int i = 1,u,v;i < n;++i){cin >> u >> v;g[u].pb(v);5 行未改动cin >> s >> t;add(s,t,dfn[s]);add(s,t,dfn[t]);}solve(1);cout << ans / 2 << '\n';cerr << "time used: " << 1.0 * clock() / CLOCKS_PER_SEC * 1000 << "ms\n";cerr << "memory used: " << abs(&ST - &ED) / 1024.0 / 1024.0 << " MB\n";return 0;}3 行未改动