欢迎来到天天文库
浏览记录
ID:57644456
大小:71.73 KB
页数:21页
时间:2020-08-30
《浙江大学2012计算机保研上机试题.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、说明:浙大2012年保研复试总共分三批,第一批为招收的全部为直博生,没有上机考试;第二批为学术型硕士和少量直博生,第三批为学术型、专业型硕士和少量直博生,二三批均有上机考试,今年第二批题目稍微偏难。第二批上机题目A.ReversiblePrimes(20)时间限制400ms内存限制32000kB代码长度限制8000B判题程序Standard作者CHEN,YueAreversibleprimeinanynumbersystemisaprimewhose"reverse"inthatnumbersystemisalsoaprime.Forexampleinthedecimalsystem73i
2、sareversibleprimebecauseitsreverse37isalsoaprime.NowgivenanytwopositiveintegersN(<105)andD(13、Specification:Foreachtestcase,printinoneline"Yes"ifNisareversibleprimewithradixD,or"No"ifnot.SampleInput:73102322310-2SampleOutput:YesYesNoB.PhoneBills(25)时间限制400ms内存限制32000kB代码长度限制8000B判题程序Standard作者CHEN,YueAlong-distancetelephonecompanychargesitscustomersbythefollowingrules:Makingalong-distancec4、allcostsacertainamountperminute,dependingonthetimeofdaywhenthecallismade.Whenacustomerstartsconnectingalong-distancecall,thetimewillberecorded,andsowillbethetimewhenthecustomerhangsupthephone.Everycalendarmonth,abillissenttothecustomerforeachminutecalled(ataratedeterminedbythetimeofday).Yourjobist5、opreparethebillsforeachmonth,givenasetofphonecallrecords.InputSpecification:Eachinputfilecontainsonetestcase.Eachcasehastwoparts:theratestructure,andthephonecallrecords.Theratestructureconsistsofalinewith24non-negativeintegersdenotingthetoll(cents/minute)from00:00-01:00,thetollfrom01:00-02:00,ands6、oonforeachhourintheday.ThenextlinecontainsapositivenumberN(<=1000),followedbyNlinesofrecords.Eachphonecallrecordconsistsofthenameofthecustomer(stringofupto20characterswithoutspace),thetimeanddate(mm:dd:hh:mm),andtheword"on-line"or"off-line".Foreachtestcase,alldateswillbewithinasinglemonth.Each"on-7、line"recordispairedwiththechronologicallynextrecordforthesamecustomerprovideditisan"off-line"record.Any"on-line"recordsthatarenotpairedwithan"off-line"recordareignored,asare"off-line"recordsnotpairedwithan"on-lin
3、Specification:Foreachtestcase,printinoneline"Yes"ifNisareversibleprimewithradixD,or"No"ifnot.SampleInput:73102322310-2SampleOutput:YesYesNoB.PhoneBills(25)时间限制400ms内存限制32000kB代码长度限制8000B判题程序Standard作者CHEN,YueAlong-distancetelephonecompanychargesitscustomersbythefollowingrules:Makingalong-distancec
4、allcostsacertainamountperminute,dependingonthetimeofdaywhenthecallismade.Whenacustomerstartsconnectingalong-distancecall,thetimewillberecorded,andsowillbethetimewhenthecustomerhangsupthephone.Everycalendarmonth,abillissenttothecustomerforeachminutecalled(ataratedeterminedbythetimeofday).Yourjobist
5、opreparethebillsforeachmonth,givenasetofphonecallrecords.InputSpecification:Eachinputfilecontainsonetestcase.Eachcasehastwoparts:theratestructure,andthephonecallrecords.Theratestructureconsistsofalinewith24non-negativeintegersdenotingthetoll(cents/minute)from00:00-01:00,thetollfrom01:00-02:00,ands
6、oonforeachhourintheday.ThenextlinecontainsapositivenumberN(<=1000),followedbyNlinesofrecords.Eachphonecallrecordconsistsofthenameofthecustomer(stringofupto20characterswithoutspace),thetimeanddate(mm:dd:hh:mm),andtheword"on-line"or"off-line".Foreachtestcase,alldateswillbewithinasinglemonth.Each"on-
7、line"recordispairedwiththechronologicallynextrecordforthesamecustomerprovideditisan"off-line"record.Any"on-line"recordsthatarenotpairedwithan"off-line"recordareignored,asare"off-line"recordsnotpairedwithan"on-lin
此文档下载收益归作者所有