// Problem: #10103. 「一本通 3.6 练习 4」电力 // Contest: LibreOJ // URL: https://loj.ac/p/10103 // Memory Limit: 64 MB // Time Limit: 5000 ms // // Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h> usingnamespace std; //#define int long long inlineintread(){int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+ (x<<3)+(ch^48);ch=getchar();}return x*f;} //#define mo #define N 10010 structnode { int x, y, n; }d[N*200]; int n, m, i, j, k; int u, v, h[N], ans; int dep[N], zi[N], zao[N];
voidcun(int x, int y) { d[++k].x=x; d[k].y=y; d[k].n=h[x]; h[x]=k; }