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 n...
分类:
其他好文 时间:
2014-10-19 01:13:19
阅读次数:
210
1.清空正在运行的文件: cat /dev/null > filename cp /dev/null filename 貌似说效率更高,但没感觉。更喜欢第一个。2.nohup: no hang up 不挂起 3.grep -o 'str' fileName |wc –l 统计某个字符串出现的次数4....
分类:
其他好文 时间:
2014-10-18 16:46:18
阅读次数:
200
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4619题意:平面上有一些1×2的骨牌,每张骨牌要么水平放置,要么竖直放置,并且保证同方向放置的骨牌不会相互覆盖。水平放置的牌和竖直放置的牌可能相互覆盖,现在要移去一些牌,使得剩下的牌任何两张都不会相互覆盖...
分类:
其他好文 时间:
2014-10-18 13:47:33
阅读次数:
169
Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.Solution:N-Queens 问题的简化版。pu...
分类:
其他好文 时间:
2014-10-18 07:32:25
阅读次数:
159
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Solution:快慢指针。 1 /** 2 * Definition for s....
分类:
其他好文 时间:
2014-10-17 15:16:48
阅读次数:
179
例程:#include void up_and_down(int);int main(void){ up_and_down(1); return 0;}void up_and_down(int n){ printf("level %d: n location %p\n", n, &...
分类:
其他好文 时间:
2014-10-17 11:00:04
阅读次数:
119
最近在上coursera上的proglang,用的是sml,但是在mac居然不能用up和down箭头键来回翻命令,还以为是sml的问题,今天在windows装了一个,居然可以使用,原来是mac的原因。用google搜索“sml mac command history...
分类:
系统相关 时间:
2014-10-17 03:30:33
阅读次数:
391
A code sequence made up multiple instructions and specifying an offset from a base address is identified in an object file. The offset from the base a...
分类:
移动开发 时间:
2014-10-17 03:16:23
阅读次数:
268
HDU 3954 Level up
题目链接
题意:k个等级,n个英雄,每个等级升级有一定经验,每次两种操作,一个区间加上val,这样区间内英雄都获得当前等级*val的经验,另一个操作询问区间经验最大值
思路:由于等级少,所以每个结点用Max[10]记录下每个等级的最大值,如果有一个升级就一直找到底,因为一个英雄升级最多10次,所以这个操作最多就10W次可以接受,剩下就是普通的区...
分类:
其他好文 时间:
2014-10-17 00:59:13
阅读次数:
163
【题目】
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#...
分类:
其他好文 时间:
2014-10-16 18:00:42
阅读次数:
245