??Classes类Classes are the most important building block of any object-oriented system. A class is a description of a set of objects that share the sam...
分类:
其他好文 时间:
2014-09-01 19:08:53
阅读次数:
235
Sorting is one of the most usedoperations in real life, where Computer Science comes into act. It iswell-known that the lower bound of swap based sorting is nlog(n).It means that the best possible sor...
分类:
其他好文 时间:
2014-09-01 10:50:23
阅读次数:
234
问题描述
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list....
分类:
其他好文 时间:
2014-08-31 23:05:42
阅读次数:
390
refer from :http://explainextended.com/2009/07/16/inner-join-vs-cross-apply/INNER JOINis the most used construct inSQL: it joins two tables together, ...
分类:
移动开发 时间:
2014-08-31 18:29:51
阅读次数:
158
Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie...
分类:
其他好文 时间:
2014-08-31 13:05:01
阅读次数:
176
题意:二维坐标系里有 n 个点 (i, ai), ai >= 0,从 (i, ai)到(i, 0)划竖线,共有 n 条竖线。
找出两条竖线,使得它们构成的矩形的面积最大,矩形的高取决于最短的竖线。
思路:贪心
从首尾两个下标head 和trail 处开始扫描,用一个变量 maxArea 保持当前最大的矩形面积。
如果head 指向的竖线短于 trail 的,则右移 head
否则左移 trail
计算面积,更新 maxArea
复杂度:时间O(n),空间O(1)
int maxArea(vector<in...
分类:
其他好文 时间:
2014-08-30 16:27:49
阅读次数:
223
Description
Alice and Bob are very smart guys and they like to play all kinds of games in their spare time. the most amazing thing is that they always find the best strategy, and that's why they fe...
分类:
其他好文 时间:
2014-08-28 16:55:48
阅读次数:
303
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1598题目思路:对于这个题目,可以先按速度的大小成小到大排序,再成0 到 m ,把所有可以联通的道路全部暴搜一遍,一但联通,两者的min=两者的速度差,依次成0 到 找 m 找,如果找到更最小的就取代min...
分类:
其他好文 时间:
2014-08-28 14:42:29
阅读次数:
253
Bean bags for many years. Although it is an old design, people feel like it, and still one of the most sought after tools today. If you are looking fo...
分类:
其他好文 时间:
2014-08-28 13:01:39
阅读次数:
263
RSA
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1415 Accepted Submission(s): 1017
Problem Description
RSA is one of the most...
分类:
其他好文 时间:
2014-08-28 09:44:19
阅读次数:
191