• 「BZOJ1053」[HAOI2007] 反素数ant

    「BZOJ1053」[HAOI2007] 反素数ant

    Description 对于任何正整数x,其约数的个数记作g(x)。例如g(1)=1、g(6)=4。如果某个正整数x满足:g(x)>g(i)0<i<x,则称x为反质数。例如,整数1,2,4,6等都是反质数。现在给定一个数N,你能求出不超过N的最大的反质数么?Input一个数N(1<=N<=2,000,000,000)。Output不超过N的最大的反质数。SampleInput1000SampleOutput840题解本题似乎要先知道许多结论,不要问我证明。。一个数约数个数=所有...

    32014年5月22日9,233深度搜索
  • 「BZOJ1260」[CQOI2007] 涂色paint

    「BZOJ1260」[CQOI2007] 涂色paint

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

    02014年5月22日6,005区间动规
  • 「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-687eacc1f2e48188056726/] ...

    12014年5月22日4,597随机化
  • 「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,864递推与动规
  • 「CF431B」Shower Line

    「CF431B」Shower Line

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

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

    「CF431A」Black Square

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

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

    「POJ2069」Super Star

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

    02014年5月22日2,873其它
  • 「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日3,061贪心,筛法
  • 「JoyOI1551」平衡的爱

    「JoyOI1551」平衡的爱

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

    02014年5月21日3,076其它
  • 「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,502其它
  • 「BZOJ1296」[SCOI2009] 粉刷匠

    「BZOJ1296」[SCOI2009] 粉刷匠

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

    12014年5月20日5,662递推与动规,背包动规
  • 「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,383递推与动规,单调队列
90 / 144 « 上一页 1 ...88 89 90 91 92 ...144 下一页 »