杭电内部比赛题文档格式.docx
- 文档编号:21342223
- 上传时间:2023-01-29
- 格式:DOCX
- 页数:11
- 大小:34.17KB
杭电内部比赛题文档格式.docx
《杭电内部比赛题文档格式.docx》由会员分享,可在线阅读,更多相关《杭电内部比赛题文档格式.docx(11页珍藏版)》请在冰豆网上搜索。
1<
=N<
=109
=k1,k2,k3<
=200
Output
Foreachcase,youshouldoutput"
Case#i:
"
first,iisthecasenumber.
Thenoutput4integersa1,a2,a3,a4,representthenumberofcardsineachpile.
SampleInput
1
120234
SampleOutput
Case#1:
40302426
1002Dualhorsetail
Nanaya'
sfavoriteDualhorsetailrobothasrunoutofpower!
AsabestfriendofNanaya,Cdfpyswdecidetodosomethingforhim.
Cdfpysw,thekingofalpaca,hassomeverypowerfulenergyballsnumberedby1,2,3……n.HeletNanayadividethemintosomesetstosavetherobot.
However,iftherearethreeballswhosenumbersarelabeledX,YandX&
Yinthesameset,theywillexplode!
Nanayamustdividetheseballsintosomesetsandavoidexplosion.
Nanayaisashyman,hedon'
twanttodividetheseballsintotoomanysets.Pleasetellhimtheminimumnumberofsets.
ThefirstlinecontainsanintegerT,indicatingthenumberofcases.
ThenextTline,eachlinecontainsanintegernindicatingthenumberofballs.(1<
=n<
=109)
Foreachtestcaseintheinput,printoneline:
Case#X:
Y"
whereXisthetestcasenumber(startingwith1)andYrepresentstheminimumnumberofsets.
2
3
1
Case#2:
2
1003Triangle
Thisisasimplequestion,giveyouatriangle,pleasedividethetriangleintotwopartswithasegment.
Thesetwopartsshouldhavethesamearea,andthesegmentshouldbeasshortaspossible.Pleasecalculatethelengthofthesegment.
ThefirstlineoftheinputisthenumberT(T<
=100),whichisthenumberofcasesfollowed.
Foreachtestcase,theonlylinecontainsspace-separatedintegersx1,y1,x2,y2,x3,y3,thecoordinatesoftriangleendpoint.
Theabsolutevalueofallthecoordinateswillnotbemorethan109.
Foreachtestcase,outputonlyoneline,containingthelengthofsegmentonly.Youranswershouldberoundedto4digitsafterthedecimalpoint.
00100010
6.4359
1004Race
Recently,Cdfpysw,thekingofalpaca,holdaspecialgo-kartrace.
Therearencontestantsnumberedby1,2,3……npreparingatthestartline,andeachgo-karthasanacceleratedspeedvirepresentingthattheirspeedwillincreasebyviateachendofthesecond.Theystartattheendoftime0,andtheinitialspeedisall0.
Cdfpyswisabusyman.Becauseofthat,hewon'
twatchthegameallthetime.Hewillwatchthegameattheendoftsecond,2tsecond,3tsecond……andrecordthefirstonenowinthegame.(Ifthereisatie,theonewiththesmallestidisthefirstone.)Andhealsodon'
twantthegamebeboring,soafterrecordinghewillusemagictoslowdownthefirstone'
sspeedto0!
Now,Cdfpyswwanttoknowthefirstmtimeshewatchthegame,whoisthefirstone.
NotethatchangingspeedandrecordingisbothattheendofasecondandchangingspeedisbeforeCdfpysw'
srecording.
Thefirstlinecontainsthreeintegersn,mandt,descriptedabove.
(1<
=100,1<
=m<
=t<
=100)
Thesecondlinecontainsnintegersvi,representingthei_thgo-kart'
sacceleratedspeed.(0<
=vi<
Onelinecontainsmintegersseperatedbyblank,representingtheanswer.
322
234
32
1005Bilibili
Cdfpyswlovestowatchvideosat.
Whenhewatchvideos,hecanwritesomecomments,andtheywillbeshownonhisscreen.
Hisscreenhassizeofn*m,andeverywordhassizeof1*1.WhenCdfpyswsendacomment,it'
llbeshownontherightmostofthetopmostlinewhichdoesn'
tcontainanycomment.Iftherearecommentsinalllines,thiscommentwillbefailedtosend.Everysecond,thecommentsonthescreenwillbeshiftedtoleftfor1beforethenewcommentsbesend.
e.g.:
Now,thefollowingpictureisthescreen.Cdfpyswwantstowrite3commentsatnow,1secondlater,and6secondslater.Theywillbeshownonthe2ndline,5thline,and1stline.
ThisexampleisNOTsameasthesamplebelow!
NowCdfpyswwantstoknowhiscommentswouldbeshownonwhichline,ifthecommentisfailedtosend,print"
Failed!
"
Foreachcase
Thefirstlinecontains3integers,n,m,q,meansthesizeofscreenandthenumberofcommentsCdfpyswwantstosend.
Thenqlines,foreachline,thereare2integerst,l,meansthesendingtimeandthelengthofthecomment.Itisguaranteedthattisinascendingorder.
=10
=n,m,q<
=50000
0<
=l<
Foreachcase,youshouldprint"
inaline,iisthecasenumber.
Thenqlines,eachlinecontainsanintegertorepresentthelinetoshowthecommentorastring"
torepresentthecommentisfailedtosend.
557
03
43
75
81
910
105
115
4
5
1006Matrix
Youaregivenamatrixwhichisnrowsmcolumns(1<
=100).Youaresupposedtochoosenelements,thereisnomorethan1elementinthesamerowandnomorethan1elementinthesamecolumn.WhatistheminimumvalueoftheK_thlargestinthenelementsyouhavechosen.
FirstlineisanintegerT(T≤15),thenumberoftestcases.Atthebeginningofeachcaseisthreeintegersn,m,K,1<
=K<
=100.
Thennlinesaregiven.Eachlinecontainsmintegers,indicatingthematrix.
Alltheelementsofthematrixisintherange[1,109].
Foreachcase,outputCase#k:
onelinefirst,wherekmeansthecasenumbercountfrom1.Thenoutputtheanswer.
231
124
241
342
1566
8343
6863
3
1007StoneGame
CdfpyswandNanayalovetoplaysomegamestogether.Today,theyfindanewstonegame.
ThereareNpilesofstonesonthetable,therearea_istonesinthei_thpile.
Theywillplayinturns.Ineachturn,oneplayershouldtakeoutsomestonesinonepile.Ifstoneshetakesisk,allstonesbeforehetakesinthatpileisp.Itshouldbesatisfiedthatk>
0andgcd(k,p)=1.gcd(a,b)meansthegreatestcommondivisorofaandb.
Cdfpyswwilltakethefirstturn,andthefirstonewhocannottakestonesistheloser.
Iftheywillbothusethebeststrategyforwin,canyoupredictwhowillbethewinner?
Foreachcase:
ThefirstlineisanintegerN,meansthenumberofpiles.
ThenextlinecontainsNintegersa_1,a_2,...,a_N,meansthenumberofstonesineachpile.
=50
N<
=106
=a_i<
Ineachcase,youshouldoutput"
Case#%d:
first.
Thenyoushouldprintthewinner'
sname,"
Cdfpysw"
or"
Nanaya"
24
13
135
Nanaya
Cdfpysw
Case#3:
1008Queen
Asweknow,thequeenisverystronginChess.Givenaninfinitechessboardwithonequeenandnpawns.Nowifallthepawnsarefrozenandonlythequeencanmove.Obviously,thequeencancaptureallthepawnsinfinitesteps.Butwhatwewanttoknowisthathowmanypawnsthequeencancaptureatmostifthequeenmustcapturethosepawnsintheorderfrom1ton.Giventhepositionsofthequeenandthosepawns,answerthequestion.
Ifyoudon'
tknowhowthequeenmoves,checkthefollowinginformation:
Thequeencanmovein8directionswithanysteps.Itmuststopafteritcapturesapieceanditcan'
tcrossapieceineachmove.
Givenanintegerinthefirstlineindicatingthenumberofcases.
Ineachcase,givenanintegernindicatingthenumberofpawnsinthefirstline.
Inthefollowingnlines,fortheithline,giventwointegersxandy,indicatingthecoordinate(x,y)oftheithpawn.
ThelastlineineachcaseshowtwointegersXandYindicatingthecoordinate(X,Y)ofthequeen.
1<
=n<
=100
-109<
=allthecoordinates<
Foreachcase,youshouldoutputonlyoneline.
First,youshouldoutput"
inwhichiindicatesthecasenumber.
Thenoutputthenumberofthepawnswhichcanbecapturedatmost.
15
22
1010
31
41
42
44
34
14
12
11
21
2020
33
1009Captain
Asyouknow,ACMisacontestwhichrequiresgoodteamworkbetweenteammembers.NowistheFujianProvincialCollegiateProgrammingContest,thecoachoftheUESTC-ACMteamYangSirwantstochooseTHREEplayerstoformateamtotakepartinthecontest.ThereareNACMersintheUESTC-ACMteam,andeachonehasanabilityvalueVi.TheACMerisalwaysAoJiao,soeachplayerwantstobetheleaderoftheteam.AndtheACMerisalsoweird,hewillthinkhimselfastheleaderoftheteamifando
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 内部 比赛