A. 字符串

    Type: Default File IO: string 1000ms 512MiB

字符串

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

大样例

给定两个仅包含小写字母的字符串 s,ts,t,你需要求出有多少个字符串 xx 满足可以从 ss 中选出一个非空前缀 pp,从 tt 中选出一个非空后缀 qq,且 x=p+qx=p+q++ 表示字符串拼接)。

由于答案可能很大,你需要求出对 998244353998244353 取模后的结果。

输入描述

共两行。

第一行一个字符串 ss

第二行一个字符串 tt

输出描述

共一行一个整数,表示满足条件的字符串的数量对 998244353998244353 取模后的结果。

样例输入 1

minecraft
deadcells

样例输出 1

77

样例输入 2

phigros
arcaea

样例输出 2

41

n=s,m=tn=|s|,m=|t|

对于 100%100\% 的数据,保证 1n,m1061\le n,m\le 10^6s,ts,t 中仅包含小写字母。

测试点编号 n,mn,m\le
11 100100
22 500500
33 20002000
44 50005000
55 10610^6

2025 NOIP模拟赛 Round 4

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2025-9-27 8:30
End at
2025-9-29 0:30
Duration
40 hour(s)
Host
Partic.
11