#include #include using namespace std; int root[111]; int find(int x){ if(root[x] == x)return x; return root[x] = find(root[x]); } void meld(int x, int y){ x = find(x); y = find(y); root[x] = y; } bool spec[111]; string solve(int N, vector D, vector W){ for(int i=0;i> N; vector D(N), W(N); for(int i=0;i> D[i]; } for(int i=0;i> W[i]; } cout << solve(N, D, W) << endl; return 0; }