Codeforces Round #736 (Div. 1), problem: (A) Web of Lies
只要记下每个点有没有比它大的father就好了,每个点father数从0到1和从1到0都进行记录,时间复杂度仅为O(m+q)#include <bits/stdc++.h>using namespace std;int const N = 200010;int ct[N];int main() { int n, m; cin >> n >> m; int cnt = 0; for (int i = 1; i <= m;