• 「CF405C」Unusual Product

    「CF405C」Unusual Product

    LittleChrisisahugefanoflinearalgebra.Thistimehehasbeengivenahomeworkaboutthe unusualsquare ofasquarematrix.The dotproduct oftwointegernumbervectors x and y ofsize n isthesumoftheproductsofthecorrespondingcomponentsofthevectors.The unusualsquare ofan n × n squarematrix A isdefinedasthesumof n dotproducts.The i-thofthemisthedotproductofthe i-throwvectorandthe i-thcolum...

    02014年3月23日2,166模拟
  • 「CF405B」Domino Effect

    「CF405B」Domino Effect

    LittleChrisknowsthere'snofuninplayingdominoes,hethinksit'stoorandomanddoesn'trequireskill.Instead,hedecidedtoplay with thedominoesandmakea"dominoshow".Chrisarranges n dominoesinaline,placingeachpieceverticallyupright.Inthebeginning,hesimultaneouslypushessomeofthedominoeseithertotheleftortotheright.However,somewherebetweeneverytwodominoespushedinthesamedirectionthereisatleastonedominopush...

    12014年3月23日2,567模拟
  • 「CF405A」Gravity Flip

    「CF405A」Gravity Flip

    LittleChrisisboredduringhisphysicslessons(tooeasy),sohehasbuiltatoyboxtokeephimselfoccupied.Theboxisspecial,sinceithastheabilitytochangegravity.Thereare n columnsoftoycubesintheboxarrangedinaline.The i-thcolumncontains ai cubes.Atfirst,thegravityintheboxispullingthecubesdownwards.WhenChrisswitchesthegravity,itbeginstopullallthecubestotherightsideofthebox.Thefigureshowstheinitialandfi...

    02014年3月23日2,174模拟
  • 最小字符串

    最小字符串

    「题目描述」给定一些字符串(只包含小写字母),要求将他们串起来构成一个字典序最小的字符串。 「输入格式」第一行T,表示有T组数据。接下来T组数据每组第一行一个正整数n,表示字符串个数。接下来n行,每行一个字符串(长度不超过100)。 「输出格式」T个字典序最小的字符串。 「样例输入」13abc「样例输出」abc「数据范围」对于30%的数据T<=100;对于100%的数据T<=7000,n<=100;题解[crayon-662e8e57...

    02014年3月22日3,744模拟
  • 「JoyOI1460」旅行

    「JoyOI1460」旅行

    描述DescriptionA国有n座城市,每座城市都十分美,这使得A国的民众们非常喜欢旅行。然而,A国的交通十分落后,这里只有m条双向的道路,并且这些道路都十分崎岖,有的甚至还是山路,只能靠步行。通过每条道路的长度、泥泞程度等因素,我们给每条道路评估一个“崎岖度”,表示通过这条道路的不舒适程度。从X城市经过若干条道路到达Y城市,我们称这次旅行的“代价”为所经过道路“崎岖度”的最大值。当然,如果从X城市到Y城市...

    112014年3月20日4,611二分法,并查集
  • 「POJ2392」Space Elevator

    「POJ2392」Space Elevator

    DescriptionThecowsaregoingtospace!Theyplantoachieveorbitbybuildingasortofspaceelevator:agianttowerofblocks.TheyhaveK(1<=K<=400)differenttypesofblockswithwhichtobuildthetower.Eachblockoftypeihasheighth_i(1<=h_i<=100)andisavailableinquantityc_i(1<=c_i<=10).Duetopossibledamagecausedbycosmicrays,nopartofablockoftypeicanexceedamaximumaltitudea_i(1<=a_i<=40000).Helptheco...

    02014年3月18日3,321贪心,背包动规
  • 「CF402A」Nuts

    「CF402A」Nuts

    Youhave a nutsandlotsofboxes.Theboxeshaveawonderfulfeature:ifyouput x (x ≥ 0) divisors(thespacialbarsthatcandivideabox)toit,yougetabox,dividedinto x + 1 sections.Youareminimalist.Therefore,ontheonehand,youareagainstdividingsomeboxintomorethan k sections.Ontheotherhand,youareagainstputtingmorethan v nutsintosomesectionofthebox.Whatistheminimumnumberofboxesyouhavetouseifyouwant...

    02014年3月17日2,745模拟
  • 「CF402B」Trees in a Row

    「CF402B」Trees in a Row

    TheQueenofEnglandhas n treesgrowinginarowinhergarden.Atthat,the i-th (1 ≤ i ≤ n) treefromthelefthasheight aimeters.TodaytheQueendecidedtoupdatethesceneryofhergarden.Shewantsthetrees'heightstomeetthecondition:foralli (1 ≤ i < n), ai + 1 - ai = k,where k isthenumbertheQueenchose.Unfortunately,theroyalgardenerisnotamachineandhecannotfulfillthedesireoftheQueenin...

    02014年3月17日2,308模拟
  • 「BZOJ1263」[SCOI2006] 整数划分

    「BZOJ1263」[SCOI2006] 整数划分

    Description从文件中读入一个正整数n(10≤n≤31000)。要求将n写成若干个正整数之和,并且使这些正整数的乘积最大。例如,n=13,则当n表示为4+3+3+3(或2+2+3+3+3)时,乘积=108为最大。Input只有一个正整数:n(10≤n≤31000)Output第1行输出一个整数,为最大乘积的位数。第2行输出最大乘积的前100位,如果不足100位,则按实际位数输出最大乘积。(提示:在给定的范围内,最大乘积的位数不超过5000位)。SampleInput13Sam...

    32014年3月16日4,403高精度
  • 「NOIP模拟赛」高级打字机

    「NOIP模拟赛」高级打字机

    高级打字机(type.cpp/c/pas)「题目描述」早苗入手了最新的高级打字机。最新款自然有着与以往不同的功能,那就是它具备撤销功能,厉害吧。请为这种高级打字机设计一个程序,支持如下3种操作:1.Tx:在文章末尾打下一个小写字母x。(type操作)2.Ux:撤销最后的x次修改操作。(Undo操作)(注意Query操作并不算修改操作)3.Qx:询问当前文章中第x个字母并输出。(Query操作)文章一开始可以视为空串。 「输入格式」第1行:一...

    92014年3月15日4,001模拟
  • 「BZOJ1305」[CQOI2009] dance跳舞

    「BZOJ1305」[CQOI2009] dance跳舞

    Description一次舞会有n个男孩和n个女孩。每首曲子开始时,所有男孩和女孩恰好配成n对跳交谊舞。每个男孩都不会和同一个女孩跳两首(或更多)舞曲。有一些男孩女孩相互喜欢,而其他相互不喜欢(不会“单向喜欢”)。每个男孩最多只愿意和k个不喜欢的女孩跳舞,而每个女孩也最多只愿意和k个不喜欢的男孩跳舞。给出每对男孩女孩是否相互喜欢的信息,舞会最多能有几首舞曲?Input第一行包含两个整数n和k。以下n行每行包含n个字符,其...

    02014年3月13日7,008二分法,最大流
  • 「BZOJ1088」[SCOI2005] 扫雷Mine

    「BZOJ1088」[SCOI2005] 扫雷Mine

    Description相信大家都玩过扫雷的游戏。那是在一个n*m的矩阵里面有一些雷,要你根据一些信息找出雷来。万圣节到了,“余”人国流行起了一种简单的扫雷游戏,这个游戏规则和扫雷一样,如果某个格子没有雷,那么它里面的数字表示和它8连通的格子里面雷的数目。现在棋盘是n×2的,第一列里面某些格子是雷,而第二列没有雷,如下图:由于第一列的雷可能有多种方案满足第二列的数的限制,你的任务即根据第二列的信息确定第一列雷有多少...

    02014年3月13日4,778模拟
32 / 41 « 上一页 1 ...30 31 32 33 34 ...41 下一页 »