上一页 1 ··· 8 9 10 11 12 13 下一页
摘要: 题意:给一个数组,计算需要的冒泡排序的次数,元素个数很大,不能用n^2的冒泡排序计算。 解析:这题实际上就是求逆序对的个数,可以用归并排序的方法,我这里用另一种方法写,bit树+离散化。由于元素的值可以达到很大,但元素个数最多只有500000个,可以先对这些数排序,离散化一下,比如5个数:1 5 8 阅读全文
posted @ 2015-08-26 19:42 wust_ouyangli 阅读(272) 评论(0) 推荐(0) 编辑
摘要: Mery has a beautiful necklace. The necklace is made up of N magic balls. Each ball has a beautiful value. The balls with the same beautiful value look 阅读全文
posted @ 2015-08-26 19:14 wust_ouyangli 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Clairewd’s message Clairewd is a member of FBI. After several years concealing in BUPT, she intercepted some important messages and she was preparing 阅读全文
posted @ 2015-08-24 21:14 wust_ouyangli 阅读(248) 评论(0) 推荐(0) 编辑
摘要: LCIS Given n integers. You have two operations: U A B: replace the Ath number by B. (index counting from 0) Q A B: output the length of the longest co 阅读全文
posted @ 2015-08-24 20:42 wust_ouyangli 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Hotel The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Be 阅读全文
posted @ 2015-08-24 20:13 wust_ouyangli 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题意:有N件T恤,N是6的倍数,因为有6种型号,每种件数相同,有M个人,每个人有两种型号的T恤适合他,每个人可以挑其中的一种,问能否所有的人都能分配到T恤。解析:典型的二分图匹配,每N/6为同种T恤,对于单个人,将他与它适合的两种T恤的所有标号连边,最后计算最大匹配,如果小于M,则不可行,否则可行。... 阅读全文
posted @ 2015-08-20 10:03 wust_ouyangli 阅读(297) 评论(0) 推荐(0) 编辑
摘要: Doing HomeworkIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of han... 阅读全文
posted @ 2015-08-20 09:35 wust_ouyangli 阅读(1129) 评论(0) 推荐(1) 编辑
摘要: Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or greater located within t... 阅读全文
posted @ 2015-08-20 09:07 wust_ouyangli 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 龟兔赛跑据说在很久很久以前,可怜的兔子经历了人生中最大的打击――赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好好得教训一下乌龟,以雪前耻。 最近正值HDU举办50周年校庆,社... 阅读全文
posted @ 2015-08-20 08:29 wust_ouyangli 阅读(525) 评论(0) 推荐(0) 编辑
摘要: 题意:有很多层盒子,盒子里面再套盒子,一个盒子可能套多个独立的子盒子,但子盒子的总体积必须小于该盒子,否则不合法,输入给一行数,负数代表左边,正数代表右边,大小表示其体积,如-2,-1,1,2则表示体积为2的盒子里套一个体积为1的盒子,再比如-5,-2,2,-1,1,5表示体积为5的盒子套两个盒子分... 阅读全文
posted @ 2015-08-19 20:49 wust_ouyangli 阅读(128) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 下一页