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

18474번 - Grammarly 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB44161593.750%

문제

CauchySheep has a string s.

He looked at all its different non-empty substrings and added a directed edge from a to b if |b| + 1 = |a| and b is a substring of a.

You need to calculate the number of simple paths starting from s in this graph, modulo 998 244 353.

입력

The first line of the input contains a string s consisting of lowercase Latin letters: the string CauchySheep has (1 ≤ |s| ≤ 300 000).

출력

Output one integer: the number of simple paths starting from s in CauchySheep’s graph, modulo 998 244 353.

제한

예제 입력 1

abba

예제 출력 1

13

예제 입력 2

benbeipo

예제 출력 2

255

예제 입력 3

iqiiiiiiqq

예제 출력 3

300

예제 입력 4

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

예제 출력 4

35

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2019 > Day 2: 300iq Contest 2 G번

Contest > Open Cup > 2019/2020 Season > Stage 1: Grand Prix of Kazan G번

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

출처

대학교 대회

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

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