#include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e5+1000; int head[N],num_edge; struct Edge{int next,to;}ed[N]; void add(int from,int to){ ed[++num_edge]={head[from],to};//here head[from]=num_edge; }