摘要: 题目大意是 只能利用左右交换完成一次排序,求一共有几种最小交换次数的方法按照题目的意思来dfs就行了。。自己写又写烦了。。受之前一道类似的题目影响,先求出最小方法数然后用子集构造去做。最后WA而且逆序多的话就卡了学习了别人的写法比较简单题目:Mapping the SwapsSorting an array can be done by swapping certain pairs of adjacent entries in the array. This is the fundamental technique used in the well-known bubble sort. If 阅读全文
posted @ 2013-12-19 23:54 doubleshik 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 有点小坑的一道题。。 一开始没多想就写了全排列看相邻两个球。。但是可能会有两个极大的圆。。。用坐标来确定每一个球的点。。枚举当前点和之前已经确定了圆相切后确定最右边的坐标,最后确定RECT最大值。题目: How Big Is It?Ian's going to California, and he has to pack his things, including his collection of circles. Given a set of circles, your program must find the smallest rectangular box in which 阅读全文
posted @ 2013-12-19 00:34 doubleshik 阅读(259) 评论(0) 推荐(0) 编辑