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

J5. CCC Word Hunt

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

의견: 0

설명

In the CCC Word Hunt, words are hidden in a grid of letters. The
letters of a hidden word always appear in order on horizontal, vertical,
or diagonal line segments in one of two ways. One way is for the letters
of a word to appear on one line segment. The other way is for the
letters of a word to appear on one line segment up to some letter and
then on a second line segment that forms a right angle at this
letter.

Given a grid of letters and a single word to search for, your job is
to determine the number of times that particular word is hidden in the
grid.

제약

\(R~(1 \le R \le 100)\)
\(C~(1 \le C \le 100)\)

입력 형식

The first line of input will contain a string of distinct uppercase
letters, \(W\), representing the word
you are to search for in the grid. The length of \(W\) will be at least two. The second line
of input will be an integer \(R~(1 \le R \le 100)\), where \(R\) is the
number of rows in the grid. The third line of input will be an integer
\(C~(1 \le C \le 100)\), where \(C\) is the number of columns in the
grid.

The remaining input will provide the letters in the grid. It will
consist of \(R\) lines, where each line
contains \(C\) uppercase letters
separated by single spaces.

출력 형식

The output will consist of a single non-negative integer \(H\), representing the number of times the
word is hidden in the grid.

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

1

13점

On one horizontal line segment

2

13점

On one horizontal or vertical line segment

3

13점

On one horizontal, vertical, or diagonal line segment

4

61점

On one line segment or two perpendicular line segments

예제 1
입력
MENU
5
7
F T R U B L K
P M N A X C U
A E R C N E O
M N E U A R M
M U N E M N S
출력
3
설명

The word MENU is hidden three times in the grid. Once
horizontally, once vertically, and once diagonally as shown. Notice that a single letter can be used more than once.

예제 2
입력
NATURE
6
9
N A T S F E G Q N
S A I B M R H F A
C F T J C U C L T
K B H U P T A N U
D P R R R J D I R
I E E K M E G B E
출력
4
설명

The word NATURE is hidden four times in the grid. Once
diagonally, once vertically, and twice on perpendicular line
segments.

문제 정보

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

출처 CCC 2023 Junior

평가 및 의견

J5. CCC Word Hunt

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

Log in to rate problems.

개별 의견

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

풀이 제출

J5. CCC Word Hunt

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