欢迎来到天天文库
浏览记录
ID:8806776
大小:43.00 KB
页数:3页
时间:2018-04-08
《acm2014年河南省热身赛》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、河南省第七届大学生程序设计竞赛主办:河南省计算机学会承办:解放军信息工程大学(热身赛)地点:信息工程大学(新校区)时间:2014年5月14日【A】最长公共子序列TimeLimit:1000MS给定一个字符序列X=(x1,x2,…,xm),其子序列是指从中随意地(不一定连续)去掉若干个字符(可能一个也不去掉)后,按原顺序所形成的序列。给定两个序列X=(x1,x2,…,xm),Y=(y1,y2,…,yn),若Z=(Z1,Z2,…,ZK)既是X的子序列,又是Y的子序列,则称Y是X和Y的公共子序列。对给定的两个字符序列,求出他们最长的公共子
2、序列长度。【标准输入】第1行:N表示有N组测试数据(1≤N≤10)第2~N+1行:x1x2…xmy1y2…yn每行两个字符串,一个空格隔开【标准输出】输出有N行。每行一个整数,表示X和Y的最长公共子序列的长度。【约束条件】字符串全由大写的26个英文字母组成,每个字符串的长度<=50【样例】标准输入标准输出2ACSBCCCCBEEYABCDYYYYWYUOPYTTT20【B】ClimbingWormTimeLimit:1000MS【Description】AnwormisatthebottomofawellNinchesdeep.It
3、hasenoughenergytoclimbUincheseveryminute,butthenhastorestaminutebeforeclimbingagain.Duringtherest,itslipsdownDinches.Theprocessofclimbingandrestingthenrepeats.Howlongbeforethewormclimbsoutofthewell?We'llalwayscountaportionofaminuteasawholeminuteandifthewormjustreachest
4、hetopofthewellattheendofitsclimbing,we'llassumethewormmakesitout.【Standardinput】Theinputconsistsofmultipletestcases.Eachtestcasecontains3positiveintegersN,UandD.Thesegivethevaluesmentionedintheparagraphabove.Furthermore,youmayassumeD5、output【Standardoutput】Foreachtestcase,printasingleintegeronaline,indicatingthenumberofminutesittakesforthewormtoclimboutofthewell.【SampleInput】【SampleOutput】66215217000
5、output【Standardoutput】Foreachtestcase,printasingleintegeronaline,indicatingthenumberofminutesittakesforthewormtoclimboutofthewell.【SampleInput】【SampleOutput】66215217000
此文档下载收益归作者所有