• 「CF430B」Balls Game

    「CF430B」Balls Game

    IahubistrainingfortheIOI.WhatisabetterwaytotrainthanplayingaZuma-likegame?Thereare n ballsputinarow.Eachballiscoloredinoneof k colors.Initiallytherowdoesn'tcontainthreeormorecontiguousballswiththesamecolor.Iahubhasasingleballofcolor x.Hecaninserthisballatanypositionintherow(probably,betweentwootherballs).Ifatanymomenttherearethreeormorecontiguousballsofthesamecolorintherow,theyare...

    02014年5月12日2,144模拟
  • 「CF430A」POInts and Segments(easy)

    「CF430A」POInts and Segments(easy)

    Iahubisn'twellpreparedongeometryproblems,butheheardthatthisyeartherewillbealotofgeometryproblemsontheIOIselectioncamp.Scared,Iahublockedhimselfinthebasementandstartedthinkingofnewproblemsofthiskind.Oneofthemisthefollowing.Iahubwantstodraw n distinctpointsand m segmentsonthe OX axis.Hecandraweachpointwitheitherredorblue.Thedrawingisgoodifandonlyifthefollowingrequirementismet:forea...

    02014年5月12日3,696构造
  • 「NOIP模拟赛」机器人

    「NOIP模拟赛」机器人

    「题目描述」早苗入手了最新的Gundam模型。最新款自然有着与以往不同的功能,那就是它能够自动行走,厉害吧。早苗的新模型可以按照输入的命令进行移动,命令包括‘E’、‘S’、‘W’、‘N’四种,分别对应东南西北。执行某个命令时,它会向对应方向移动一个单位。作为新型机器人,它可以执行命令串。对于输入的命令串,每一秒它会按命令行动一次。执行完命令串的最后一个命令后,会自动从头开始循环。在0时刻时机器人位于(0,...

    02014年5月10日2,938模拟
  • 「BZOJ1800」[Ahoi2009] fly 飞行棋

    「BZOJ1800」[Ahoi2009] fly 飞行棋

    Description给出圆周上的若干个点,已知点与点之间的弧长,其值均为正整数,并依圆周顺序排列。请找出这些点中有没有可以围成矩形的,并希望在最短时间内找出所有不重复矩形。Input第一行为正整数N,表示点的个数,接下来N行分别为这N个点所分割的各个圆弧长度Output所构成不重复矩形的个数SampleInput812231133SampleOutput3HINTN<=20题解20的数据范围直接使其变成水题[crayon-67a5b25c5592a383364424/] ...

    02014年5月8日3,397模拟
  • 「BZOJ2697」特技飞行

    「BZOJ2697」特技飞行

    Description神犇航空开展了一项载客特技飞行业务。每次飞行长N个单位时间,每个单位时间可以进行一项特技动作,可选的动作有K种,每种动作有一个刺激程度Ci。如果连续进行相同的动作,乘客会感到厌倦,所以定义某次动作的价值为(距上次该动作的时间)*Ci,若为第一次进行该动作,价值为0。安排一种方案,使得总价值最大。Input  第一行,两个数,N和K,如上所述;第二行,K个正整数,表示K种动作的Ci值。Output  仅...

    02014年5月8日3,829贪心
  • 「BZOJ1150」[CTSC2007] 数据备份Backup

    「BZOJ1150」[CTSC2007] 数据备份Backup

    Description Input输入的第一行包含整数n和k,其中n(2≤n≤100000)表示办公楼的数目,k(1≤k≤n/2)表示可利用的网络电缆的数目。接下来的n行每行仅包含一个整数(0≤s≤1000000000),表示每个办公楼到大街起点处的距离。这些整数将按照从小到大的顺序依次出现。Output输出应由一个正整数组成,给出将2K个相异的办公楼连成k对所需的网络电缆的最小总长度。SampleInput52134612SampleOutput4HINT上面的样例输入给出...

    02014年5月7日7,828贪心,,链表
  • 「BZOJ2288」「POJ Challenge」生日礼物

    「BZOJ2288」「POJ Challenge」生日礼物

    Descriptionftiasch18岁生日的时候,lqp18_31给她看了一个神奇的序列 A1, A2,..., AN.她被允许选择不超过 M 个连续的部分作为自己的生日礼物。自然地,ftiasch想要知道选择元素之和的最大值。你能帮助她吗?Input第1行,两个整数 N (1≤ N ≤105)和 M (0≤ M ≤105),序列的长度和可以选择的部分。第2行, N 个整数 A1, A2,..., AN (0≤|Ai|≤104),序列。Output一个整数,最大的和。SampleI...

    12014年5月7日7,708,贪心,链表
  • 「CF427A」Police Recruits

    「CF427A」Police Recruits

    Thepolicedepartmentofyourcityhasjuststarteditsjourney.Initially,theydon’thaveanymanpower.So,theystartedhiringnewrecruitsingroups.Meanwhile,crimeskeepsoccurringwithinthecity.Onememberofthepoliceforcecaninvestigateonlyonecrimeduringhis/herlifetime.Ifthereisnopoliceofficerfree(isn'tbusywithcrime)duringtheoccurrenceofacrime,itwillgountreated.Giventhechronologicalorderofcrimeoccurrencesandrecru...

    02014年5月3日2,237模拟
  • 「BZOJ1863 / 3761」[ZJOI2006] trouble 皇帝的烦恼

    「BZOJ1863 / 3761」[ZJOI2006] trouble 皇帝的烦恼

    Description经过多年的杀戮,秦皇终于统一了中国。为了抵御外来的侵略,他准备在国土边境安置n名将军。不幸的是这n名将军羽翼渐丰,开始展露他们的狼子野心了。他们拒绝述职、拒绝接受皇帝的圣旨。秦皇已经准备好了秘密处决这些无礼的边防大将。不过为防兵变,他决定先授予这些将军一些勋章,为自己赢得战略时间。将军们听说他们即将被授予勋章都很开心,他们纷纷上书表示感谢。第i个将军要求得到ai枚不同颜色的勋章。但是这些将军...

    02014年5月1日3,965二分法
  • 「BZOJ2396」神奇的矩阵

    「BZOJ2396」神奇的矩阵

    Description   给出三个行数和列数均为N的矩阵A、B、C,判断A*B=C是否成立。Input   题目可能包含若干组数据。对于每组数据,第一行一个数N,接下来给出三个N*N的矩阵,依次为A、B、C三个矩阵。Output   对于每组数据,若A*B=C成立,则输出Yes,否则No。每个答案占一行。SampleInput122100SampleOutputNoHINT   对于90%的数据,N不超过100;对于100%的数据,N不超过1000,矩阵中的数字...

    12014年4月29日4,010随机化
  • 「CF425D」Sereja and Squares

    「CF425D」Sereja and Squares

    Serejahaspainted n distinctpointsontheplane.Thecoordinatesofeachpointareintegers.Nowheiswondering:howmanysquaresaretherewithsidesparalleltothecoordinateaxesandwithpointspaintedinallitsfourvertexes?Helphim,calculatethisnumber.InputThefirstlinecontainsinteger n (1 ≤ n ≤ 105).Eachofthenext n linescontainstwointegers xi, yi (0 ≤ xi, yi ≤ 105),theintegersrepresentthecoordin...

    02014年4月28日4,400二分法
  • 「CF425A」Sereja and Swaps

    「CF425A」Sereja and Swaps

    Asusual,Serejahasarray a,itselementsareintegers: a[1], a[2], ..., a[n].Let'sintroducenotation:Aswapoperationisthefollowingsequenceofactions:choosetwoindexes i, j (i ≠ j);performassignments tmp = a[i], a[i] = a[j], a[j] = tmp.Whatmaximumvalueoffunction m(a) canSerejagetifheisallowedtoperformatmost k swapoperations?InputThefirstlinecontainstwointegers n and k (1 ...

    02014年4月28日3,530贪心
28 / 41 « 上一页 1 ...26 27 28 29 30 ...41 下一页 »