acm第3周周赛试题

acm第3周周赛试题

ID:15348166

大小:72.00 KB

页数:13页

时间:2018-08-02

acm第3周周赛试题_第1页
acm第3周周赛试题_第2页
acm第3周周赛试题_第3页
acm第3周周赛试题_第4页
acm第3周周赛试题_第5页
资源描述:

《acm第3周周赛试题》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、A:MaxSumofMax-K-sub-sequence(3415)TimeLimit:2000/1000MS(Java/Others)    MemoryLimit:32768/32768K(Java/Others)本套试题摘自杭电:http://acm.hdu.edu.cn/vip/contest_show.php?cid=291TotalSubmission(s):525    AcceptedSubmission(s):51ProblemDescriptionGivenacirclesequenceA[1],A[2],A

2、[3]......A[n].CirclesequencemeanstheleftneighbourofA[1]isA[n],andtherightneighbourofA[n]isA[1].NowyourjobistocalculatethemaxsumofaMax-K-sub-sequence.Max-K-sub-sequencemeansacontinuousnon-emptysub-sequencewhichlengthnotexceedK. InputThefirstlineoftheinputcontainsanint

3、egerT(1<=T<=100)whichmeansthenumberoftestcases.ThenTlinesfollow,eachlinestartswithtwointegersN,K(1<=N<=100000,1<=K<=N),thenNintegersfollowed(alltheintegersarebetween-1000and1000). OutputForeachtestcase,youshouldoutputalinecontainsthreeintegers,theMaxSuminthesequence,

4、thestartpositionofthesub-sequence,theendpositionofthesub-sequence.Iftherearemorethanoneresult,outputtheminimumstartposition,ifstillmorethanone,outputtheminimumlengthofthem. SampleInput4636-12-65-5646-12-65-563-12-65-5666-1-1-1-1-1-1 SampleOutput713713762-111B:Marriag

5、eMatchIVTimeLimit:2000/1000MS(Java/Others)    MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):295    AcceptedSubmission(s):38ProblemDescriptionDonotsincerenon-interference。Likethatshow,nowstarvaealsotakepartinashow,butittakeplacebetweencityAandB.Starvaeisinci

6、tyAandgirlsareincityB.EverytimestarvaecangettocityBandmakeadatawithagirlhelikes.Buttherearetwoproblemswithit,oneisstarvaemustgettoBwithinleasttime,it'ssaidthathemusttakeashortestpath.Otherisnoroadcanbetakenmorethanonce.Whilethecitystarvaepassedawaycanbeentakenmoretha

7、nonce.So,underagoodRP,starvaemayhavemanychancestogettocityB.Buthedon'tknowhowmanychancesatmosthecanmakeadatawiththegirlhelikes.Couldyouhelpstarvae? InputThefirstlineisanintegerTindicatingthecasenumber.(1<=T<=65)Foreachcase,therearetwointegernandminthefirstline(2<=n<=

8、1000,0<=m<=100000),nisthenumberofthecityandmisthenumberoftheroads.Thenfollowsmline,eachlinehavethreeintegersa,b,c,(1<=a,b<=n,0

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。