| TeamsCode Summer 2024 Novice Division |
|---|
| Закончено |
I BET IT DOES!
Ifrit is an operator in Arknights who specializes in mapwide war crimes. You are tasked to increase the efficiency with which said war crimes are committed.
A map in Arknights can be represented as an $$$n$$$ by $$$m$$$ grid with three types of tiles:
Let the upper-left tile be $$$(1, 1)$$$ and the bottom-right tile be $$$(n, m)$$$. We say a tile $$$(x, y)$$$ is an Ifrit Tile if the following conditions hold:
For a given map, count all Ifrit Tiles.
The first line of input contains two integers $$$n$$$ and $$$m$$$ denoting the length and width of the map $$$(1 \leq n, m \leq 1000)$$$.
The following $$$n$$$ lines each contain a string of length $$$m$$$, the $$$j$$$'th character on the $$$i$$$'th row being either an H, L, or #, denoting that tile $$$(i, j)$$$ is a tile of that type as defined in the statement.
—
Tests in subtasks are numbered from $$$1 - 10$$$ with samples skipped. Each test is worth $$$\frac{100}{10} = 10$$$ points.
Tests $$$1 - 3$$$ satisfy that $$$n, m \leq 10$$$.
The remaining tests do not satisfy any additional constraints.
Output a single integer, denoting the number of Ifrit Tiles on the map.
5 7##HLHH##HHLHH#LLLLLLL##HHLHH##HHLH#
4
The Ifrit Tiles are $$$(1, 5)$$$, $$$(2, 5)$$$, $$$(4, 4)$$$, and $$$(5, 4)$$$. Ifrit should be placed facing down, down, up, and up respectively on these tiles to hit at least two low-ground tiles.
This map is also the stage $$$1-1$$$ in Arknights.
—
Problem Idea: willy108
Problem Preparation: willy108
Occurrences: Novice B
| Название |
|---|


