上一页 1 ··· 21 22 23 24 25

2013年11月28日

poj2828(Buy Tickets)线段树

摘要: Buy TicketsTime Limit: 4000MSMemory Limit: 65536KTotal Submissions: 11157Accepted: 5450DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little Cat still had schedul 阅读全文

posted @ 2013-11-28 17:53 jec 阅读(177) 评论(0) 推荐(0) 编辑

hdu2795(Billboard)线段树

摘要: BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 8266 Accepted Submission(s): 3676 Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is 阅读全文

posted @ 2013-11-28 09:19 jec 阅读(224) 评论(0) 推荐(0) 编辑

2013年11月27日

hdu1394(Minimum Inversion Number)线段树

摘要: 明知道是线段树,却写不出来,搞了半天,戳,没办法,最后还是得去看题解(有待于提高啊啊),想做道题还是难啊。还是先贴题吧HDU-1394 Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8324Accepted Submission(s): 5115Problem DescriptionThe inversion number of a given number sequence a1, a2, . 阅读全文

posted @ 2013-11-27 23:05 jec 阅读(200) 评论(0) 推荐(0) 编辑

2013年11月26日

hdu4407Sum(容斥原理)

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4407Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s)... 阅读全文

posted @ 2013-11-26 20:06 jec 阅读(273) 评论(0) 推荐(0) 编辑

2013年11月23日

树的重心

摘要: 看了网上大牛们求重心的方法,自己也写写。假设x结点是树的重心,那么现在删除一个树的结点,就可以得到一些子树,那么得到的子树中结点个数最大的数要最小就是树的重心。(有点啰嗦)root = min(max(son(x)))枚举树的每个结点,计算以每个结点为根的对应的各个子树的结点的最大值,然后再取一个最... 阅读全文

posted @ 2013-11-23 14:01 jec 阅读(309) 评论(0) 推荐(0) 编辑

2013年11月12日

匈牙利算法

摘要: 匈牙利算法本文参考了大牛博客:https://www.byvoid.com/blog/hungary/设G=(V,E)是一个无向图。如顶点集V可分割为两个互不相交的子集V1,V2之选择这样的子集中边数最大的子集称为图的最大匹配问题(maximal matching problem)如果一个匹配中,|... 阅读全文

posted @ 2013-11-12 22:05 jec 阅读(310) 评论(0) 推荐(0) 编辑

2013年11月11日

快速排列组合

摘要: 组合数c(n, m) = n! / (m!.(n - m)!),n! = elnn! = e(ln1 + ln2 + ... + lnn)则c(n, m) = e(ln1 + ln2 + ... + lnn) / (e(ln1 + ln2 + ... + lnm).e(ln1 + ln2 + ...... 阅读全文

posted @ 2013-11-11 13:16 jec 阅读(357) 评论(0) 推荐(0) 编辑

最大公约数和最小公倍数

只有注册用户登录后才能阅读该文。 阅读全文

posted @ 2013-11-11 12:26 jec 阅读(4) 评论(0) 推荐(0) 编辑

上一页 1 ··· 21 22 23 24 25

导航