RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00519

Konj

Unrated 레이팅 미적용
난이도
1s
시간 제한
64MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

1 \(s / 64\) \(MB / 70\) points

Domagoj loves drawing horses at leisure. For a long time, he's been a proud member of social

groups dealing with this subject. But Domagoj is a very special boy, so because of his drawing

technique most people do not understand his masterpieces.

One of his most famous drawings is "#define HORSE \(42-42\) ", also known as " Ordinary Horse" .

15
2 2 6 2
2 2 2 6
6 2 6 4
6 4 6 6
2 6 6 6
6 2 8 2
8 2 10 2
10 2 12 2
12 2 12 4
12 4 6 4
6 2 6 1
8 2 8 0
10 2 10 1
12 2 12 0
42 42 42 43
2 2

You must be wondering "Where \(is\) that horse?" and "Is everything all right with Domagoj?" because

you only see some numbers on the drawing. The first question will be answered in the next section,

while the answer to the second question also interests the author of this task.

In order to understand the drawing, you need to understand Domagoj's drawing technique. The first

number in the drawing is the number \(N\) denoting the number of line segments that may have been

drawn. Thereafter, the following \(N\) lines have four numbers, \(A\) {i} { }, \(B\) {i} { }, \(C\) {i} and \(D\) } , which describe the \(i\) ^{th

line segment extending from the point ( \(A\) {i}{ }, \(B\) {i}{ }) to the point ( \(C\) {i}{ }, \(D\) {i}{ }). In the last line of the drawing there

are two numbers, \(X\) and \(Y\) , the coordinates of point \(T\) . Domagoj will draw all the line segments that

contain the point \(T\) and all that are directly or indirectly connected to a line segment that contains

point \(T\) . For two line segments \(L\) {1} and \(L\) we say that they are directly connected if they have a

common end point, and they are indirectly connected if there is a sequence of line segments \(L\) {1}{ }, \(H\) {1}{ },

\(H\) {2}{ }, ... \(H\) {k}{ }, \(L\) {2} such that the line segments \(L\) and \(H\) {1} are directly connected, \(H\) are directly} and \(H\) _{2

connected, ..., \(H\) {k}{ } and \(L\) {2}{ } are directly connected.

Your task is to print a rectangular matrix \(P\) of characters that displays Domagoj's drawing. The value

of \(P\) _{a,b} should be set to '#' if the point with the coordinates ( a, b) is part of some line segment drawn,

otherwise this value should be set to '.'. Coordinate \(a\) in the matrix rises from left to right , while

coordinate \(b\) rises from bottom up . Matrix \(P\) should contain all points that are part of a drawn lines

and should not contain any single row or column that contains only characters '.', i.e. it should be

minimal in size.

제약

In the test samples totally worth 30% of the points you should draw all line segments.

입력 형식

In the first line of the input there is a positive integer \(N\) (1 ≤ \(N\) ≤ 200 000) .

1 \(s / 64\) \(MB / 70\) points

In the next \(N\) lines there four n\(on-ne\)gative integers \(A\) {i}{ }, B {i}{ }, C {i} and \(D\) (0 ≤ \(A\) {i}{ }, B {i}{ }, C {i}{ }, D _{i} ≤300). For each

line segment it will hold either \(A\) {i} ≠C or \(B\) {i} ≠D No two line segments will intersect, but some might} _{

have common end point. All the will be parallel to the coordinate axes.
In the last line of the input there will be two n\(on-ne\)gative integers \(X\) and Y, coordinates of the point T.

Point \(T\) will be part of at least one of the given line segment.

출력 형식

Print required matrix \(P\) from the task.

예제 1
입력
15
2 2 6 2
2 2 2 6
6 2 6 4
6 4 6 6
2 6 6 6
6 2 8 2
8 2 10 2
10 2 12 2
12 2 12 4
12 4 6 4
6 2 6 1
8 2 8 0
10 2 10 1
12 2 12 0
42 42 42 43
2 2

6
1 1 10 1
10 1 10 3
10 3 1 3
1 3 1 1
10 3 11 3
11 3 11 6
2 1
출력
output
#####......
#...#......
#...#######
#...#.....#
###########
....#.#.#.#
......#...#

..........#
..........#
..........#
###########
#........#.
##########.



1 s / 64 MB / 70 points
설명

Clarification of sample tests:
In the first example all the line segments should be drawn except the last, and in the second example all the
line segments should be drawn to get the drawing of the name "Summarized horse".

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2018/2019 Contest 6

평가 및 의견

Konj

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Konj

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8