我知道做题先看标签是不好的习惯
本题数据范围 n≤106n\le 10^6n≤106 ,并且数据卡了 dinic\text{dinic}dinic。匈牙利就更别想了。正解好像是并查集。
综上,建议去除标签中的“网络流”和“二分图”