#P7712. [Ynoi2077] hlcpq
[Ynoi2077] hlcpq
Problem Description
On a plane, you are given horizontal line segments and vertical line segments. It is guaranteed that no two different segments lie on the same straight line.
If two segments have an intersection point, then they are connected. If are connected and are connected, then are connected.
A segment is critical if and only if there exist two other segments such that are connected, and after deleting , are no longer connected.
Input Format
The first line contains an integer .
The next lines: the -th line contains two integers (), representing a horizontal segment with and .
The next lines: the -th line contains two integers (), representing a vertical segment with and .
Output Format
Output two lines, each being a string of length .
The -th character of the first line is if and only if the -th horizontal segment is critical.
The -th character of the second line is if and only if the -th vertical segment is critical.
10
1 4
2 7
1 6
3 7
2 4
1 9
1 3
9 10
3 5
1 7
1 7
1 3
1 3
3 7
1 2
3 5
1 7
5 7
3 9
9 10
0100010000
1001000010
Hint
Idea: ccz181078, Solution: ccz181078, Code: ccz181078, Data: ccz181078&nzhtl1477
Constraints: for of the testdata, .
Translated by ChatGPT 5