#include #include typedef struct { int XL, XR, YD; } enemy; int compare(const void *x, const void *y) { return ((enemy*)y)->YD - ((enemy*)x)->YD; } int main(void) { int N, xLB, xRB, width[1280] = {}, i, j; enemy hitJudge[188]; scanf("%d%d%d", &N, &xLB, &xRB); for (i = xLB; i <= xRB; ++i) width[i - 1] = 1; for (i = 0; i < N; ++i) scanf("%d%*d%d%d", &hitJudge[i].XL, &hitJudge[i].XR, &hitJudge[i].YD); qsort(hitJudge, N, sizeof(enemy), compare); for (i = 0; i < N; ++i) { for (j = hitJudge[i].XL; j <= hitJudge[i].XR; ++j) { if (width[j - 1] == 1) break; } if (j != hitJudge[i].XR + 1) { for (j = hitJudge[i].XL; j <= hitJudge[i].XR; ++j) width[j - 1] = 0; puts("1"); } else puts("0"); } return 0; }