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

23708번 - Filipp Rukhovich 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6 초 (추가 시간 없음) 512 MB976100.000%

문제

The palindromicity of a sequence of characters $t$ of length $k$ is number of indices $i,ドル such that 0ドル \leq i < k - i - 1$ and $t_i = t_{k - 1 - i}$. Note that 0-based indexing is used.

You are given a string $s$. Count the sum of palindromicities over all its subsequences. Sequences which occur multiple times as a subsequence are counted multiple times (i.e. you sum palindromicities over all 2ドル^{|s|}$ subsequences whether they are distinct or not).

Output the correct answer modulo 998244353ドル$. Formally, if the actual answer is $y$ and your answer is $x,ドル it will be considered correct if $-2^{63} \leq x < 2^{63}$ and $x-y$ is divisible by 998244353ドル$.

입력

The only line contains a non-empty string $s$ of lowercase latin letters with length not exceeding 123456ドル$.

출력

Output a single integer --- sum of palindromicities over all subsequences of $s$ modulo 998244353ドル$.

제한

예제 입력 1

xxx

예제 출력 1

4

예제 입력 2

abacaba

예제 출력 2

80

예제 입력 3

ypiiouiuiputrhgogghjhp

예제 출력 3

1084841

예제 입력 4

dfgfhdgdhjgfdhgdfhgfdgfddfg

예제 출력 4

190900560

예제 입력 5

qweqwewqewqeqweqwqwewqrqwrrew

예제 출력 5

910048289

예제 입력 6

thosewereactuallykeyboardslaps

예제 출력 6

405649044

힌트

출처

Contest > Open Cup > 2018/2019 Season > Stage 16: Grand Prix of Moscow F번

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

출처

대학교 대회

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

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