”神秘题解“就在《!!神秘题解!!3》
。
。
。
。
。
。
。
。
#include <bits/stdc++.h>
using namespace std;
int a[100010], number;
vector<int> v[100010];
inline int dfs(int x, int fa, int cnt) {
int res = cnt + a[x];
if (res == number) {
return -1;
}
int m = 0;
for (auto u : v[x]) {
if (u ^ fa) {
int t = dfs(u, x, res);
if (t == -1) {
return -1;
}
m += (t == 1 ? 1 : 0);
if (m > 1 || t == 99999) {
return 99999;
}
}
}
return m + a[x] > 0;
}
signed main() {
iossync_with_stdio(false);
ios_basesync_with_stdio(false);
cin.tie(0), cout.tie(0);
int t;
cin >> t;
while (t--) {
number = 0;
bool flag = false;
}