当前位置 :
【ACM一道题关于字母对应数字的情况数的DescriptionAliceandBobneedtosendsecretmessagestoeachotherandarediscussingwaystoencodetheirmessages:Alice:"Let'sjustuseaverysimplecode:We'llassign`A'thecodeword1,`B'will】
1人问答
八字精批流年运程八字合婚八字起名
问题描述:

ACM一道题关于字母对应数字的情况数的

Description

AliceandBobneedtosendsecretmessagestoeachotherandarediscussingwaystoencodetheirmessages:Alice:"Let'sjustuseaverysimplecode:We'llassign`A'thecodeword1,`B'willbe2,andsoondownto`Z'beingassigned26."Bob:"That'sastupidcode,Alice.SupposeIsendyoutheword`BEAN'encodedas25114.Youcoulddecodethatinmanydifferentways!"Alice:"Sureyoucould,butwhatwordswouldyouget?Otherthan`BEAN',you'dget`BEAAD',`YAAD',`YAN',`YKD'and`BEKD'.Ithinkyouwouldbeabletofigureoutthecorrectdecoding.Andwhywouldyousendmetheword`BEAN'anyway?"Bob:"OK,maybethat'sabadexample,butIbetyouthatifyougotastringoflength500therewouldbetonsofdifferentdecodingsandwiththatmanyyouwouldfindatleasttwodifferentonesthatwouldmakesense."Alice:"Howmanydifferentdecodings?"Bob:"Jillions!"Forsomereason,AliceisstillunconvincedbyBob'sargument,sosherequiresaprogramthatwilldeterminehowmanydecodingstherecanbeforagivenstringusinghercode.

Input

Inputwillconsistofmultipleinputsets.Eachsetwillconsistofasinglelineofdigitsrepresentingavalidencryption(forexample,nolinewillbeginwitha0).Therewillbenospacesbetweenthedigits.Aninputlineof`0'willterminatetheinputandshouldnotbeprocessed

Output

ForeachinputSampleInput

Copytoclipboard

25114

1111111111

3333333333

SampleOutput

6

89

1

能否提供更多的测试用例给我?

更多的测试用例,

刘跃虎回答:
  222222222->5522222222->342222222->21222222->1322222->82222->5222->322->2123123123123->8112312312312->541231231231->27123123123->2712312312->181231231->9123123->912312->61231->3123->312->2
八字精批 八字合婚 八字起名 八字财运 2024运势 测终身运 姓名详批 结婚吉日
已出生未出生
最新更新
热门英语
PC端 | 移动端 | mip端
字典翻译(zidianfy.com)汇总了汉语字典,新华字典,成语字典,组词,词语,在线查字典,中文字典,英汉字典,在线字典,康熙字典等等,是学生查询学习资料的好帮手,是老师教学的好助手。
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
电话:  邮箱:
Copyright©2009-2021 字典翻译 zidianfy.com 版权所有 闽ICP备2022014709号-7
lyric 頭條新聞
复制重新加载
原创不易,您的支持将成为鼓励我的动力
《【ACM一道题关于字母对应数字的情况数的DescriptionAliceandBobneedtosendsecretmessagestoeachotherandarediscussingwaystoencodetheirmessages:Alice:"Let'sjustuseaverysimplecode:We'llassign`A'thecodeword1,`B'will】|小学英语问答-字典翻译问答网》
1、付费复制方式
支付宝付费后即可复制当前文章
限时特价:5.99元
原价:20元
打开支付页
2、微信付费复制方式
微信扫码付费后即可复制当前文章
限时特价:5.99元
原价:20元