• 「BZOJ1260」[CQOI2007] 涂色paint

    「BZOJ1260」[CQOI2007] 涂色paint

    Description假设你有一条长度为5的木版,初始时没有涂过任何颜色。你希望把它的5个单位长度分别涂上红、绿、蓝、绿、红色,用一个长度为5的字符串表示这个目标:RGBGR。每次你可以把一段连续的木版涂成一个给定的颜色,后涂的颜色覆盖先涂的颜色。例如第一次把木版涂成RRRRR,第二次涂成RGGGR,第三次涂成RGBGR,达到目标。用尽量少的涂色次数达到目标。Input输入仅一行,包含一个长度为n的字符串,即涂色目...

    02014年5月22日5,875区间动规
  • 「BZOJ1336 / 1337」[Balkan2002] Alien最小圆覆盖

    「BZOJ1336 / 1337」[Balkan2002] Alien最小圆覆盖

    Description给出N个点,让你画一个最小的包含所有点的圆。Input先给出点的个数N,2<=N<=100000,再给出坐标Xi,Yi.(-10000.0<=xi,yi<=10000.0)Output输出圆的半径,及圆心的坐标SampleInput68.09.04.07.51.02.05.18.79.02.04.51.0 SampleOutput5.005.005.00HINT用传说中的随机增量法,请自行百度[crayon-67a7f6cf49bb1364070666/] ...

    12014年5月22日4,503随机化
  • 「CF431C」k – Tree

    「CF431C」k - Tree

    QuiterecentlyacreativestudentLeshahadalectureontrees.AfterthelectureLeshawasinspiredandcameupwiththetreeofhisownwhichhecalleda k-tree.A k-treeisaninfiniterootedtreewhere:eachvertexhasexactly k children;eachedgehassomeweight;ifwelookattheedgesthatgoesfromsomevertextoitschildren(exactly k edges),thentheirweightswillequal 1, 2, 3, ..., k.Thepicturebelowshowsapartofa3-tree.  ...

    02014年5月22日3,783递推与动规
  • 「CF431B」Shower Line

    「CF431B」Shower Line

    Manystudentsliveinadormitory.Adormitoryisawholenewworldoffunnyamusementsandpossibilitiesbutitdoeshaveitsdrawbacks.Thereisonlyoneshowerandtherearemultiplestudentswhowishtohaveashowerinthemorning.That'swhyeverymorningthereisalineoffivepeopleinfrontofthedormitoryshowerdoor.Assoonastheshoweropens,thefirstpersonfromthelineenterstheshower.Afterawhilethefirstpersonleavestheshowerandthenextpersonent...

    02014年5月22日2,918模拟,深度搜索
  • 「CF431A」Black Square

    「CF431A」Black Square

    Quiterecently,averysmartstudentnamedJurydecidedthatlecturesareboring,sohedownloadedagamecalled"BlackSquare"onhissupercooltouchscreenphone.Inthisgame,thephone'sscreenisdividedintofourverticalstrips.Eachsecond,ablacksquareappearsonsomeofthestrips.Accordingtotherulesofthegame,Jurymustusethissecondtotouchthecorrespondingstriptomakethesquaregoaway.AsJuryisbothsmartandlazy,hecountedthathewaste...

    02014年5月22日2,464模拟
  • 「POJ2069」Super Star

    「POJ2069」Super Star

    DescriptionDuringavoyageofthestarshipHakodate-maru(seeProblem1406),researchersfoundstrangesynchronizedmovementsofstars.Havingheardtheseobservations,Dr.Extremeproposedatheoryof"superstars".Donottakethistermasadescriptionofactorsorsingers.Itisarevolutionarytheoryinastronomy.Accordingtothistheory,startsweareobservingarenotindependentobjects,butonlysmallportionsoflargerobjectscalledsuperstar...

    02014年5月22日2,788其它
  • 「432C」Prime Swaps

    「432C」Prime Swaps

    Youhaveanarray a[1], a[2], ..., a[n],containingdistinctintegersfrom 1 to n.Yourtaskistosortthisarrayinincreasingorderwiththefollowingoperation(youmayneedtoapplyitmultipletimes):choosetwoindexes, i and j (1 ≤ i < j ≤ n; (j - i + 1) isaprimenumber);swaptheelementsonpositions i and j;inotherwords,youareallowedtoapplythefollowingsequenceofassignments: tmp = a[i], a...

    02014年5月21日2,914贪心,筛法
  • 「JoyOI1551」平衡的爱

    「JoyOI1551」平衡的爱

    描述Description问题描述milesian在你的帮助下(假设你把第一题AC了~)终于摆脱了女生的诱惑。但是女生们又缠上了另外一个帅哥——taring。但是taring保持清醒的方式不同,他会选择同时和所有女生聊天。这时,所有女生,还有taring,都站在牛顿广场上。且这种诱惑能量,是一个向量。满足向量定理。这个力为Fi,现在taring,站在高台上,希望找一个点,使他所受的诱惑能量和(向量和)为0。注意,他可以选择和某一个点的女生相吻...

    02014年5月21日2,989其它
  • 「POJ2420」A Star not a Tree?

    「POJ2420」A Star not a Tree?

    DescriptionLukewantstoupgradehishomecomputernetworkfrom10mbsto100mbs.Hisexistingnetworkuses10base2(coaxial)cablesthatallowyoutoconnectanynumberofcomputerstogetherinalineararrangement.LukeisparticularyproudthathesolvedanastyNP-completeprobleminordertominimizethetotalcablelength.Unfortunately,Lukecannotusehisexistingcabling.The100mbssystemuses100baseT(twistedpair)cables.Each100baseTcable...

    32014年5月21日5,377其它
  • 「BZOJ1296」[SCOI2009] 粉刷匠

    「BZOJ1296」[SCOI2009] 粉刷匠

    Descriptionwindy有N条木板需要被粉刷。每条木板被分为M个格子。每个格子要被刷成红色或蓝色。windy每次粉刷,只能选择一条木板上一段连续的格子,然后涂上一种颜色。每个格子最多只能被粉刷一次。如果windy只能粉刷T次,他最多能正确粉刷多少格子?一个格子如果未被粉刷或者被粉刷错颜色,就算错误粉刷。Input输入文件paint.in第一行包含三个整数,NMT。接下来有N行,每行一个长度为M的字符串,'0'表示红色,'1'表示蓝色...

    12014年5月20日5,440递推与动规,背包动规
  • 「BZOJ1233」[Usaco2009Open] 干草堆tower

    「BZOJ1233」[Usaco2009Open] 干草堆tower

    Description奶牛们讨厌黑暗。为了调整牛棚顶的电灯的亮度,Bessie必须建一座干草堆使得她能够爬上去够到灯泡。一共有N大包的干草(1<=N<=100000)(从1到N编号)依靠传送带连续的传输进牛棚来。第i包干草有一个宽度W_i(1<=w_i<=10000)。所有的干草包的厚度和高度都为1.Bessie必须利用所有N包干草来建立起干草堆,并且按照他们进牛棚的顺序摆放。她可以相放多少包就放多少包来建立起tower的地基(当然是紧紧的放在...

    12014年5月20日5,282递推与动规,单调队列
  • 「JoyOI1040」表达式计算

    「JoyOI1040」表达式计算

    题目描述给出一个表达式,其中运算符仅包含+,要求求出表达式的最终值输入仅一行,即为表达式输出仅一行,既为表达式算出的结果样例输入1+1样例输出2提示 表达式总长度<=1500 代码2013.12.21[crayon-67a7f6cf4d192589981226/]2014.5.20有学弟一直纠结这个就重写了一次没写函数的。。发现代码风格变化很大[crayon-67a7f6cf4d19b476588055/]  ...

    12014年5月20日938高精度
91 / 145 « 上一页 1 ...89 90 91 92 93 ...145 下一页 »