• 离大海最远点在哪里?

    离大海最远点在哪里?

    http://218.5.5.242:9014/problem.asp?id=1678题目描述遥远的海上有一座岛屿,这个岛屿的轮廓是一个凸多边形,把边视为岛屿的海岸线。当地的居民想要在岛屿上找一地点使其到大海的距离最远,这地点应在哪里?岛上居民们习惯地把岛上某个点到岛屿的各条海岸线(即各边)距离中最小者看成该点到大海的距离。如下图所示,点O到大海的距离为min{j,k,l,m,n}=j,其中j,k,l,m,n分别为O到AB,BC,CD,DE,EA的距离。现在,给您N...

    02015年2月3日7,019STL,链表,二分法,半平面交
  • 「fjWC2015」k个串 kstring

    「fjWC2015」k个串 kstring

    「题目描述」兔子们在玩k个串的游戏。首先,它们拿出了一个长度为n的数字序列,选出其中的一个连续子串,然后统计其子串中所有数字之和(注意这里重复出现的数字只被统计一次)。兔子们想知道,在这个数字序列所有连续的子串中,按照以上方式统计其所有数字之和,第k大的和是多少。「输入格式」第一行,两个整数n和k,分别表示长度为n的数字序列和想要统计的第k大的和接下里一行n个数a_i,表示这个数字序列「输出格式」一行一个整数...

    42015年2月3日6,848STL,可持久化线段树
  • 「fjWC2015」Galaxy

    「fjWC2015」Galaxy

    「题目描述」小X进入了平行宇宙,想在某个平行宇宙开始一段生活。平行宇宙之间用长度为N的仅含有A、B、C、D四个字母的序列标识。每一个由A,B,C,D组成的长度为N的序列标识着不同的平行宇宙。有趣的是,不同的宇宙对应着小X的不同人生,在某些宇宙中,小X的人生过得并不愉快。小X得到了M个特征碎片,特征碎片都为长度小于10的由A,B,C,D构成的序列。如果某个平行宇宙的标识序列包含某个特征碎片(即特征碎片为宇宙...

    02015年2月3日4,762AC自动机,矩阵乘法
  • 「fjWC2015」Screen

    「fjWC2015」Screen

    「题目描述」码农有一块超新星屏幕,它有N个像素点,每个像素点有亮度和灰度两个参数,记为I和H,范围都是0~32000.一天,码农突发奇想,想知道哪个点比较容易亮瞎眼睛。为此,他定义了一个瞎眼指数:瞎眼指数就是灰度和亮度均不大于该像素点的像素个数。现在,码农希望知道,瞎眼指数为0~N-1的像素点分别有多少个 「输入格式」第一行一个数字N,代表有N个像素点。接下来N行,每行两个数字,代表该像素点的亮度和灰度。N个...

    02015年2月3日2,707树状数组
  • 「CF398B」Painting The Wall

    「CF398B」Painting The Wall

    Useraintadecidedtopaintawall.Thewallconsistsofn2tiles,thatarearrangedinann × ntable.Sometilesarepainted,andtheothersarenot.Ashewantstopaintitbeautifully,hewillfollowtherulesbelow.Firstlyuseraintalooksatthewall.Ifthereisatleastonepaintedcelloneachrowandatleastonepaintedcelloneachcolumn,hestopscoloring.Otherwise,hegoestostep2.Useraintachooseanytileonthewallwithuniformprobability.Ifthetil...

    02015年2月1日4,116递推与动规,概率与期望
  • 「CF83E」Two Subsequences

    「CF83E」Two Subsequences

    OnanITlessonValerastudieddatacompression.Theteachertoldaboutanewmethod,whichweshallnowdescribetoyou.Let{a1, a2, ..., an}bethegivensequenceoflinesneededtobecompressed.Hereandbelowweshallassumethatalllinesareofthesamelengthandconsistonlyofthedigits0and1.Let'sdefinethecompressionfunction:f(emptysequence) = emptystringf(s) = s.f(s1, s2) = thesmallestinlengthstring,whichhasoneofthepre...

    292015年2月1日4,935递推与动规
  • 「CF509E」Pretty Song

    「CF509E」Pretty Song

    WhenSashawasstudyingintheseventhgrade,hestartedlisteningtomusicalot.Inordertoevaluatewhichsongshelikesmore,heintroducedthenotionofthesong'sprettiness.ThetitleofthesongisawordconsistingofuppercaseLatinletters.Theprettinessofthesongistheprettinessofitstitle.Let'sdefinethesimpleprettinessofawordastheratioofthenumberofvowelsinthewordtothenumberofalllettersintheword.Let'sdefinetheprettinessofaw...

    02015年1月31日3,958其它
  • 「CF509C」Sums of Digits

    「CF509C」Sums of Digits

    Vasyahadastrictlyincreasingsequenceofpositiveintegersa1,...,an.Vasyausedittobuildanewsequenceb1,...,bn,wherebiisthesumofdigitsofai'sdecimalrepresentation.Thensequenceaigotlostandallthatremainedissequencebi.Vasyawonderswhatthenumbersaicouldbelike.Ofallthepossibleoptionshelikestheonesequencewiththeminimumpossiblelastnumberan.HelpVasyarestoretheinitialsequence.Itisguaranteedthatsuchasequencea...

    12015年1月31日3,353贪心
  • 「CF509B」Painting Pebbles

    「CF509B」Painting Pebbles

    Therearenpilesofpebblesonthetable,thei-thpilecontainsaipebbles.Yourtaskistopainteachpebbleusingoneofthekgivencolorssothatforeachcolorcandanytwopilesiandjthedifferencebetweenthenumberofpebblesofcolorcinpileiandnumberofpebblesofcolorcinpilejisatmostone.Inotherwords,let'ssaythatbi, cisthenumberofpebblesofcolorcinthei-thpile.Thenforany1 ≤ c ≤ k,1 ≤ i, j ≤ nthefollowingconditionmustbe...

    02015年1月31日3,437贪心
  • 「CF509A」Maximum in Table

    「CF509A」Maximum in Table

    Ann × ntableaisdefinedasfollows:Thefirstrowandthefirstcolumncontainones,thatis:ai, 1 = a1, i = 1foralli = 1, 2, ..., n.Eachoftheremainingnumbersinthetableisequaltothesumofthenumberaboveitandthenumbertotheleftofit.Inotherwords,theremainingelementsaredefinedbytheformulaai, j = ai - 1, j + ai, j - 1.Theseconditionsdefineallthevaluesinthetable.Youaregivenanumbern.Younee...

    02015年1月31日2,523模拟
  • 「BZOJ1998」[HNOI2010] Fsk物品调度

     「BZOJ1998」[HNOI2010] Fsk物品调度

    Description现在找工作不容易,Lostmonkey费了好大劲才得到fsk公司基层流水线操作员的职位。流水线上有n个位置,从0到n-1依次编号,一开始0号位置空,其它的位置i上有编号为i的盒子。Lostmonkey要按照以下规则重新排列这些盒子。规则由5个数描述,q,p,m,d,s,s表示空位的最终位置。首先生成一个序列c,c0=0,ci+1=(ci*q+p)modm。接下来从第一个盒子开始依次生成每个盒子的最终位置posi,posi=(ci+d*xi+yi)modn,xi,yi是为了...

    02015年1月31日4,762置换,并查集
  • 「BZOJ2004」[HNOI2010] Bus 公交线路

    「BZOJ2004」[HNOI2010] Bus 公交线路

    Description小Z所在的城市有N个公交车站,排列在一条长(N-1)km的直线上,从左到右依次编号为1到N,相邻公交车站间的距离均为1km。作为公交车线路的规划者,小Z调查了市民的需求,决定按下述规则设计线路:1.设共K辆公交车,则1到K号站作为始发站,N-K+1到N号台作为终点站。2.每个车站必须被一辆且仅一辆公交车经过(始发站和终点站也算被经过)。3.公交车只能从编号较小的站台驶往编号较大的站台。4.一辆公交车经过...

    02015年1月31日4,749状压动规
29 / 145 « 上一页 1 ...27 28 29 30 31 ...145 下一页 »