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

32543번 - Giganotosaurus Game 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB149403025.210%

문제

Suffering from a poor internet connection, you are playing a casual game in your web browser to pass the time. You, the player, control a Giganotosaurus that is running through a linear world with obstacles (cactuses). You win the game if you reach the end of the world without hitting any cactuses.

The world consists of $n$ cells, which can either be empty or contain a cactus. You start at the leftmost cell (which is always empty) and the goal is to get past the rightmost cell. At each cell, the Giganotosaurus can either move one position to the right, or jump over some fixed number of cells. For the first jump, you skip one cell, but with each subsequent jump, you skip one additional cell compared to the previous jump. That is, the $k$th jump skips exactly $k$ cells.

You quickly master this simple game, so you pose a more interesting challenge: count how many ways there are to win the game. As an example, consider the second sample case, visualized in Figure G.1.

Figure G.1: Visualization of the second sample input, for which there are three ways to win the game.

입력

The input consists of:

  • One line with an integer $n$ (1ドル \le n \le 10^5$), the length of the world.
  • One line with $n$ characters, each character being either '#' or '.', indicating a cactus or an empty cell, respectively.

출력

Output the number of ways to win the game, modulo 10ドル^9 + 7$.

제한

예제 입력 1

4
....

예제 출력 1

8

예제 입력 2

4
.#..

예제 출력 2

3

예제 입력 3

7
.#...##

예제 출력 3

1

예제 입력 4

7
..#.#.#

예제 출력 4

0

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 Preliminaries G번

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

출처

대학교 대회

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

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