首先n的范围是[2,15],所以可以用dfs搜索使得Ratio最小的点。那么思路基本清晰:首先dfs,搜索所有的点选与不选所得到的最大的Ratio,如果当前状态下得到的Ratio比之前得到的Ratio要小,那么把当前状态的vis数组更新的答案ans数组中。最后从1到n扫描ans数组即可保证答案是升序。...
分类:
其他好文 时间:
2015-08-06 18:29:18
阅读次数:
126
这道题一读就是经典的区间问题,是区间覆盖,敲过之后还有花了很长的调试时间,还是我不熟练,现在做题确实挺慢
的,简单题目也要做好久,没事,慢慢来。最重要的要确保正确率和心态问题,认真对待,调试找到了好多bug,一些
细节问题。。。都是刚开始没有注意到的。交了之后RE,在数组上多加了两个0。A了,,uva老是不提示数据有多大,
所以只能乱开。。。
思路:
先对区间按左边的点进行排序,如果当前...
分类:
其他好文 时间:
2015-08-05 12:59:57
阅读次数:
131
Given several segments of line (int the X axis) with coordinates [Li, Ri]. You are to choose the minimal amount of them, such they would completely co...
分类:
其他好文 时间:
2015-08-05 06:30:01
阅读次数:
160
Given an array ofnpositive integers and a positive integers, find the minimal length of a subarray of which the sum ≥s. If there isn't one, return 0 i...
分类:
其他好文 时间:
2015-08-05 00:30:29
阅读次数:
146
1.系统只安装了vim-minimal,执行以下命令安装另外两个组件yum install vim-commonyum install vim-enhanced2.安装ctagsyum install ctags 下载linux-2.6.32.27内核源码并解压到~/arm/linux-2.6.32...
分类:
系统相关 时间:
2015-08-03 12:57:06
阅读次数:
159
A simple windows programm in c The following programm is a minimal windows program. It opens a window and writes a text into the window.If you compi.....
4.3 Given a sorted (increasing order) array with unique integer elements, write an algorithm to create a binary search tree with minimal height.这道题给了我...
分类:
其他好文 时间:
2015-08-01 01:03:53
阅读次数:
118
Problem Description For a tree, which nodes and edges are all weighted, the ratio of it is calculated according to the following equation.Given a comp...
分类:
其他好文 时间:
2015-07-31 10:26:56
阅读次数:
119
hdu2489 Minimal Ratio Tree题意:一个 至多 n=15 的 完全图 ,求 含有 m 个节点的树 使 边权和 除 点权和 最小题解:枚举 m 个 点 ,然后 求 最小生成树自己粗心。。。。WA 了 好多次……(233333 )#include #include #include...
分类:
其他好文 时间:
2015-07-27 20:51:23
阅读次数:
125
turtlebot 有个实现iPhone360全景照相功能的应用
panorama. 官方使用Create底座和Kinnect, 在使用Roomba底座和Xtion Pro Live配套时发现,按照教程的方式启动不了。
1. 启动
roslaunch turtlebot_bringup minimal.launch \\加载轮子驱动
roslaunch turt...
分类:
其他好文 时间:
2015-07-25 01:50:22
阅读次数:
190