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

Minesweeper

설명

Marko is a regular university student who still shows up to every lecture, even
though his stomach and head often ache from studying late into the night. Because
he’s also a gifted student, he often finds the lectures boring, so instead of listening
he plays his favorite game, Minesweeper. Eventually, even that got boring, so he
decided to create his own version of the game.
In Marko’s version of Minesweeper, he starts the game already knowing the positions
of all \(k\) bombs on a board with \(n\) rows and \(m\) columns. Each cell can contain at
most one bomb.
His task is to fill every non-bomb cell with the number of bombs in the eight
surrounding cells. Cells that contain bombs are marked with "B". Your task is to output the matrix
generated according to Marko’s rules.

제약
입력 형식

In the first line are the natural numbers \(n\), \(m\) and \(k\) (\(1 \le n\), \(m \le 500\), \(1 \le k \le n \cdot m\)), the numbers from
the problem statement.
In each of the following \(k\) lines are the numbers \(r_{i}\) and \(s_{i}\) (\(1 \le r_{i} \le n\), \(1 \le s_{i} \le m\)), the row and column
in which one of the bombs is located.
Izlazni podaci
In \(n\) rows, output \(m\) characters separated by a space, the matrix produced according to the rules of
Marko’s game.
Scoring
Subtask
Points
Constraints
1
15
\(n = 1\)
2
18
\(k = 1\)
3
17
No additional constraints.

출력 형식
서브태스크
서브태스크점수설명

1

15점

\(n = 1\)

2

18점

\(k = 1\)

3

17점

No additional constraints.

예제 1
입력
1 6 1
1 3
출력
0 1 B 1 0 0
예제 2
입력
3 3 3
1 1
2 3
1 3
출력
B 3 B
1 3 B
0 1 1
설명

Clarification of the first example: In the cell in the 3rd column there is a bomb (the letter "B"). The
cells of the matrix in the 2nd and 4th columns (marked with the number 1) are adjacent to it.

문제 정보

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

출처 COCI 2025/2026 Contest 2

평가 및 의견

Minesweeper

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

Log in to rate problems.

개별 의견

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

풀이 제출

Minesweeper

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