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

An2dl

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

의견: 0

설명

While wandering around Building 21, you came across a wall completely covered
with numbers, arranged in a table of \(n\) rows and \(m\) columns. Soon you noticed
that there was a frame leaning against the wall large enough to frame \(r\) rows and
\(s\) columns of the table on the wall. And next to the frame you found a pencil and
a piece of paper containing an empty table.
You are sad that the table on the piece of paper is empty, so you decided to play
around with the frame to fill it.
You leaned the frame against the wall so that the number in the \(i-th\) row and \(j-th\) column is in the upper
left corner, and the borders of the frame are parallel to the edges of the wall. Considering the numbers
inside the frame, and since you like large numbers, you have decided to write the largest among them in
the \(i-th\) row and \(j-th\) column of the table on the piece of paper.
You repeated the process for every possible position of the frame on the wall (such that the frame is
entirely on the wall, and that there are exactly \(r \times s\) numbers inside it), making sure that the edges of the
frame are parallel to the edges of the wall.
When you were done, the table on the piece of paper was even more beautiful than the one on the wall.
What numbers are in the table on the piece of paper?

제약

Subtask 1 (12 points): n, \(m \le 40\), \(r = n\), \(s = m\)

Subtask 2 (17 points): n, \(m \le 40\)

Subtask 3 (25 points): n, \(m \le 1\,000\)

Subtask 4 (56 points): No additional constraints.

입력 형식

The first line contains two integers \(n\) and \(m\) (\(1 \le n\), \(m \le 4\,000\)), the number of rows and columns of the
table on the wall.
Each of the following \(n\) lines contain \(m\) integers \(a\)i,j (|\(a\)i,j| ≤10 000), where \(a\)i,j is the number in the \(i-th\)
row and \(j-th\) column of the table on the wall.
The last line contains two integers \(r\) and \(s\) (\(1 \le r \le n\), \(1 \le s \le m\)), the size of the frame.

출력 형식

Output the numbers written in the table on the piece of paper.

서브태스크
서브태스크점수설명

1

12점

n, \(m \le 40\), \(r = n\), \(s = m\)

2

17점

n, \(m \le 40\)

3

25점

n, \(m \le 1\,000\)

4

56점

No additional constraints.

예제 1
입력
3 3
1 1 2
2 3 4
4 3 2
3 3
출력
4
예제 2
입력
3 3
1 1 2
2 3 4
4 3 2
2 1
출력
2 3 4
4 3 4
예제 3
입력
5 5
-1 -3 -4 -2 4
-8 -7 -9 -10 11
5 2 -8 -2 1
13 -3 -2 -6 -9
11 6 2 7 4
2 3
출력
-1 -2 11
5 2 11
13 2 1
13 7 7
설명

Clarification of the first example:
The frame is big enough to fit the entire table on the wall. The largest number inside the frame is 4, so
that is the only number written on the table on the piece of paper.
Clarification of the second example:
All possible frame positions are shown in the picture below. The largest number for each of the positions
is written in red.

문제 정보

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

출처 COCI 2023/2024 Contest 1

평가 및 의견

An2dl

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

Log in to rate problems.

개별 의견

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

풀이 제출

An2dl

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