Logo
(追記) (追記ここまで)

32566번 - Word Search 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB16101083.333%

문제

Find parts of a 2d grid matching a 2d word.

입력

  • One line containing the number of rows and columns in the search key, $r_k$ and $c_k$ (1ドル \le r, c \le 2000$).
  • $r_k$ further lines, each containing $c_k$ Latin characters comprising a row of the search key.
  • One line containing the number of rows and columns in the haystack, $r_h$ and $c_h$ ($r_k \le r_h \le 2000,ドル $c_k \le c_h \le 2000$).
  • $r_h$ further lines, each containing $c_h$ Latin characters comprising a row of the search key.

출력

Illustrate the matching areas of the haystack by printing a grid of the same size. In locations that are part of at least one match, print the original character from the haystack. In other cases, print a full-stop "." character.

제한

예제 입력 1

3 3
ghi
lmn
qrs
5 5
abcde
fghij
klmno
pqrst
uvwxy

예제 출력 1

.....
.ghi.
.lmn.
.qrs.
.....

예제 입력 2

1 2
ab
6 4
abba
baab
abba
baab
abba
baab

예제 출력 2

ab..
..ab
ab..
..ab
ab..
..ab

예제 입력 3

4 1
n
a
n
a
7 6
ananan
nanana
ananan
nanana
ananan
nanana
batman

예제 출력 3

.n.n.n
nanana
ananan
nanana
ananan
.a.ana
....a.

예제 입력 4

2 2
oo
oo
5 5
xoooo
oxooo
ooxoo
oooxo
oooox

예제 출력 4

..ooo
..ooo
oo.oo
ooo..
ooo..

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2024 G번

  • 문제를 만든 사람: Robin Lee
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /