这学习,多是一件美事。果冻正在学习异世界的语言文字。他读到一篇有趣的文章。定义字符串子序列是不一定连续的子字符串,如对字符串 yisaigai
, sai
, yii
是子序列, gs
, ha
不是子序列。果冻尤其喜欢以 a
开头, k
结尾的三字词语,如 afk
, auk
。果冻想找到文章的所有子序列里有多少个子序列是这样的三字词语。
例如,假设文章为 idlikelanqiaoak
,那么其所有子序列中有 8 个 a*k
三字词。
对于如下文章,求该文章的所有子序列里有多少个是这样的三字词语。(为避免你处理标点符号,我们已去除掉所有排版和标点符号)
icpcfinalisttizhuxianshengninhaoninhaoninhaoyoushenmeshiwomennengbangdaonitizhupazhuochuanqihuwoyaoshuodeshinimenqianwanbiehaipaicpcfinalistwomenshijinpaixuanshouwomenbuhuipaninqingshuotizhuwogangcaizaileetcodezhousaibaolingicpcfinalistnoiausuranqijingzhanshuhouyangicpcfinalistleetcodeshinayiweitizhubushinayiweijiushinagehenduohenduosuanfanantideleetcodenoiauhuachunoiptizhubushizhongxueshengdadeshidaxueshengdadenoiauhuachuicpctizhubutazaiwangluoshangdadebushixianchangsainoiauhuachucodeforcestizhutinemeiyingwendetashizhongwendenoiauhuachutopcodertizhuzheicpcfinalistduoguozhihuachunanchangyaoqingsaidemoyangzhongwendetizhuyishoubazhishanfeileetcodeasuanfayoumeiyouxuejiushinagehenduonantizuoliangbaidaojiunengjingugedeleetcodemingbaimaicpcfinalistmingbaileninjixushuotizhutafengkuangdichutinuewoshuowohencaishiwenshuibuzhidaoranhourangwozibijiushangzhouliunachangquanbudoushinantihaiyouxianduanshuxianduanshushujufanweinamedazhijierangwozuowonaqijianpanzhijiedalegebaolikuajiutlewojiuxiangrennoiaupuchitizhunixiaoshenmenoiauwoxiangqigaoxingdeshiqingtizhushenmegaoxingdeshiqingnoiauwodeguangyihouzhuizidongjiparentshushangdongtaidianfenzhiacleicpcfinalistpuchitizhuniyouxiaoshenmeicpcfinalistewodeaczidongjishanggaosixiaoyuanjiegailvdpfangchengyeacletizhunimenliangguodeshitongyigetinoiauduiduiduiicpcfinalistjiannandibiezhuxiaoabushishidouyongleshujujiegoutizhuwozaizhongshenyibianwomeizaikaiwanxiaonoiauduiduinoiauicpcfinalistmeirenzhuxiaochuleshengtizhuwaifengkuangqiaozhuoicpcfinalistwomenyanguizhengchuanninganggangshuodezhegeleetcodezhousaitananmetizhutabushinanbunandewentitazhendeshinazhonghenshaojiandenazhongtadetimuhenqiaomiaodongtaiguihuaerfendaanhenyouyisirangrenbaisibudeqijieyihandeshinatiantitaiduomeinengkanwannoiaubiexiaotizhuniqirentaishenworennihenjiulenoiauwodetiacletizhunimingmingzaixiaowonidoumeitingguonoiautizhuxianshengwomenshouguohenyangedexunlianwulunduohaoxiaonewomendoubuhuixiaochufeirenbuzhuzhuantoukanxiangicpcfinalisticpcfinalistburuzheyangtizhuxianshengninxianhuiqudengxiaoxiwomenyiyoujinzhanlimatongzhinintizhuhangnimenganjinquzuohennandeduodaidianrenjifangkuangxiaonoiautizhuxianshengninhaiyoushenmeyaobuchongmajifangkuangxiaoicpcfinalisttizhuxiansheng
输入
无
输出
你的答案