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

19009번 - Equal Digits 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 256 MB106685.714%

문제

There is a string $s$ consisting of decimal digits.

You need to transform the string $s$ into any non-empty string $t$ in which all digits are different. To achieve the goal, you can choose and remove a set (possibly empty) of non-intersecting substrings such that the length of each substring is strictly greater than 1ドル,ドル and in each substring, the first digit is equal to the last one. Find the number of ways to choose such set.

Two sets are different if one of them has a substring that does not exist in the other. Substrings are different if their start or end positions differ.

Since the number of ways can be quite large, output it modulo 10ドル^9 + 7$.

입력

The single line contains the string $s$ (1ドル \le |s| \le 10^5$) consisting of decimal digits.

출력

Output one integer: the answer to the problem.

제한

예제 입력 1

88005553535

예제 출력 1

7

예제 입력 2

123

예제 출력 2

1

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2018 > Day 7: Izhevsk STU + Ufa SATU Contest A번

Contest > Open Cup > 2018/2019 Season > Stage 2: Grand Prix of Udmurtia A번

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

출처

대학교 대회

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

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