// @EXPECTED_RESULTS@: WRONG_ANSWER, TIME_LIMIT_EXCEEDED #pragma GCC optimize("Ofast") #include #include #include #include #include #include #include using namespace std; random_device rd; mt19937 rng(rd()); const int MXD = ceil(25.4*2 + 160 + 0.00001); const int MX = 1e7; double sq(double x) { return x*x; } struct DSU{ vector sz,parent; int components; DSU(int n) { sz.assign(n,1); components = n; parent.resize(n); iota(begin(parent),end(parent),0); } void link(int a, int b) { components--; if(sz[a]> n; vector> cs(n); for(auto& [x,y,r] : cs) { cin >> x >> y >> r; } sort(begin(cs),end(cs)); auto near = [&](int i, int j) { auto [x,y,r] = cs[i]; auto [x2,y2,r2] = cs[j]; return (sq(x-x2) + sq(y-y2) ) < sq(25.4*2 + (r+r2)/2.); }; vector> myblock(n); for(int i=0;i deg(n); auto addE = [&](int u, int v) { deg[u]++; deg[v]++; dsu.unite(u,v); }; for(auto [dx,dy] : {array{0,0},{0,1},{1,-1},{1,0},{1,1}}) { int it = 0, jt = 0; for(int i=0;i want = myblock[i]; want[0]+=dx,want[1]+=dy; while(it!=n and myblock[it]=2)) { cout << "yes\n"; } else cout << "no\n"; }