#include #include #include #include #include using namespace std; const int NX = 1280; const int NY = 1680; typedef bitset Seq; struct Enemy { int i; int y; bool h; Seq s; }; Seq MakeSeq(int xl, int xr) { Seq s; for (int i = xl; i <= xr; i++) { s |= Seq(1) << i; } return s; } int main() { int n, xl, xr; cin >> n >> xl >> xr; Seq b = MakeSeq(xl, xr); vector es; for (int i = 0; i < n; i++) { int y, foo; cin >> xl >> foo >> xr >> y; xl = xl < 1 ? 1 : xl; xl = xl > NX ? NX : xl; xr = xr < 1 ? 1 : xr; xr = xr > NX ? NX : xr; y = y < 1 ? 1 : y; y = y > NY ? NY : y; Enemy e; e.i = i; e.y = y; e.h = false; e.s = MakeSeq(xl, xr); es.emplace_back(e); } sort(es.begin(), es.end(), [](const Enemy& a, const Enemy& b) { return a.y > b.y; }); for (Enemy& e : es) { if (e.s != (e.s & ~b)) { e.h = true; } b = ~e.s & b; } sort(es.begin(), es.end(), [](const Enemy& a, const Enemy& b) { return a.i < b.i; }); for (const Enemy& e : es) { cout << e.h << endl; } return 0; }