Setting up a new development box for myself I had forgotten all about the necessity to use theaspnet_regiis.exe–i command. The information is fairly e...
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:
其他好文 时间:
2014-09-22 23:28:53
阅读次数:
160
题目:
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
这是一道关于链表比较简单的题,很顺利就解决了,不多说啦,上代码啦
# Definition for singly-linked list.
# ...
分类:
其他好文 时间:
2014-09-22 22:07:03
阅读次数:
233
E431系列USB启动问题1、将U盘做成Pe,开机按F12,找到U盘启动项,选中后按enter没有任何反应。2、按F1进入BIOS,在Start up设置USB作为第一启动项,在F12的列表中也是现实USB为第一启动项,但是电脑照旧是进入系统,没有任何变化。(U盘已经写入Win PE)usb识别到了...
分类:
其他好文 时间:
2014-09-22 14:58:12
阅读次数:
325
为了加强鼠标响应事件,Android提供了GestureDetector手势识别类。通过GestureDetector.OnGestureListener来获取当前被触发的操作手势(Single Tap Up、Show Press、Long Press、Scroll、Down、Fling),具体包括...
分类:
其他好文 时间:
2014-09-22 12:14:52
阅读次数:
250
题目大意:有长度为N的颜色段,共有m种颜色,要将其划分成若干段,每一段的费用为这一段的不同颜色的数目的平方。求最小总费用。
Sol:
首先我们注意到答案不超过n,因为我们显然可以将每一个划分为一段,答案为n.
于是每一段的颜色总数不超过sqrt(n).
因此我们维护最后出现的sqrt(n)种颜色最后出现的位置,进行转移。
总的时间复杂度为O(n*sqrt(n)).
Co...
分类:
其他好文 时间:
2014-09-22 10:59:52
阅读次数:
274
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5029Problem DescriptionThe soil is cracking up because of the drought and the rabbit kingdom is facing ...
分类:
其他好文 时间:
2014-09-22 02:39:21
阅读次数:
291
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
/**
* Definition for singly-linked list.
...
分类:
其他好文 时间:
2014-09-21 18:31:21
阅读次数:
233
创建 migration 需要继承自 ActiveRecord::Migration 类,常见如下:class SomeMigration < ActiveRecord::Migration def up end def down endendclass SomeMigration < ...
分类:
其他好文 时间:
2014-09-21 16:58:51
阅读次数:
211
把求和操作改为或操作,就可以了。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define lson l,m,rt>1;27 build(lson);28 build(rson);29 up(r...
分类:
其他好文 时间:
2014-09-21 11:27:10
阅读次数:
228