2013.8.5-集训队内赛试题.docx

2013.8.5-集训队内赛试题.docx

ID:57645785

大小:26.10 KB

页数:6页

时间:2020-08-30

2013.8.5-集训队内赛试题.docx_第1页
2013.8.5-集训队内赛试题.docx_第2页
2013.8.5-集训队内赛试题.docx_第3页
2013.8.5-集训队内赛试题.docx_第4页
2013.8.5-集训队内赛试题.docx_第5页
资源描述:

《2013.8.5-集训队内赛试题.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、长安大学ACM-2013暑期集训队说明:本次队内赛旨在考察大家上阶段训练情况,让大家体验一下现场的赛制。比赛通过PC^2系统进行,这也是windows环境下ACM的标准比赛系统。大家通过账号密码自行登陆,完成题目内容之后,选择题目,语言无论是C还是C++都选择GUNC++,并提交文件(.c/.cpp),文件名不限。程序中不需要使用文件输入输出,按照正常的程序提交即可。注意主函数intmain()结束时返回0。题目难度不会很大,关键在于读懂题意。另外需要多注意输入输出格式等细节问题。要特别注意以下几题的输出格式可能很像但是有区别(因为是多个人出的题)。题

2、目:A:MagicalPrimeNumberByJcf【Description】MhasalittlebrothernamedR.Oneday,R’smathteachertellshimanewword–primenumber.Risreallyinterestedintheprimenumber,soafterhereturnstohome,heaskedMforhelp.Mtellshimthatprimenumbercannotbedividedexactlybyanyothernumberexceptitselfandthenumber1,f

3、orexample,2,3,5,7,11areprimenumbers,but4isnotaprimenumber.R:So,isXaprimenumber?M:YES.R:HowaboutY?M:……Rissointerestedinitthathehasaskedmanynumbers.YourtaskiswritingaprogramtohelpManswerR’squestions.RwillaskNnumbers,foreachnumber,ifitisaprimenumber,justtellhim‘YES’.Butifitisnotapr

4、imenumber,youhavetotellhim‘NO’,thenfindthenearestprimenumberforhim.【InputFormat】Line1:Asingleinteger,N;Line2ton+1:eachlinehasanumberX,youhavetojudgewhetherXisaprimenumber.(1<=N<=15000,1<=X<=32767)【OutputFormat】WrittenByJcf长安大学ACM-2013暑期集训队ForeachX,firstyoushouldoutputthecasenumb

5、er.Output‘Case’,thenablank,then‘#’,thenablank,thenthenumberand‘:’.(Toseethesampleoutout)IfXisaprimenumber,justprint‘YES’.ButifXisnotaprimenumber,pleaseprint‘NO’inthefirstlineandthenprintaninteger(thenearestprimenumber)inthenextline.Iftherearetwoprimenumbersthathavesamedistancest

6、oX,printthebiggerone.Forexample,ifXis9,youfind7and11,boththeirdistanceis2from9,print11.Thereneedsanewlinebetweentwocases.【SampleInput】59111436【SampleOutput】Case#1:NO11Case#2:YESCase#3:NO13Case#4:YESCase#5:NO7【Hits】Takeiteasy,justusethesimplewaytosolveit,thereisnoneedforyoutousea

7、dvancedalgorithm.ButpayattentiontoyourOutputFormat.B:HelloWorld!ByLqWrittenByJcf长安大学ACM-2013暑期集训队【Description】Weallknowthatthesimplestprogramisthe“HelloWorld!”program.Thisisaproblemjustassimpleasthe“HelloWorld!”Inalargematrix,therearesomeelementshasbeenmarked.Foreverymarkedeleme

8、nt,returnamarkedelementwhoserowandcolumnarelarg

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

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

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