Corn FieldsTime Limit:2000MSMemory Limit:65536KTotal Submissions:10149Accepted:5366DescriptionFarmer John has purchased a lush new rectangular pasture...
分类:
其他好文 时间:
2015-08-26 15:19:23
阅读次数:
135
Problem:Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest fo...
分类:
其他好文 时间:
2015-08-26 13:53:07
阅读次数:
122
快排
代码:
class Solution
{
public:
int findKthLargest(vector& nums, int k)
{
int begin = 0, end = nums.size() - 1;
while (begin < end)
{
int left = begin...
分类:
其他好文 时间:
2015-08-26 12:02:46
阅读次数:
133
Description
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles...
分类:
其他好文 时间:
2015-08-25 16:42:51
阅读次数:
224
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] ha...
分类:
其他好文 时间:
2015-08-25 16:34:50
阅读次数:
164
题意:柱状图是由一些宽度相等的长方形下端对齐后横向排列得到的图形。现在有由n个宽度为1,高度分别为h1,h2,……,hn的长方形从左到右依次排列组成的柱状图。问里面包含的长方形的最大面积是多少。...
分类:
其他好文 时间:
2015-08-21 21:35:28
阅读次数:
302
Walking Ant
Time Limit: 2 Seconds
Memory Limit: 65536 KB
Ants are quite diligent. They sometimes build their nests beneath flagstones.
Here, an ant is walking in a rectangular area tile...
分类:
其他好文 时间:
2015-08-21 09:29:43
阅读次数:
186
Largest Rectangle in HistogramGivennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of l...
分类:
其他好文 时间:
2015-08-20 20:28:28
阅读次数:
98
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.
For example,
Given [3,2,1,5,6,4] and k = 2, return 5.
...
分类:
其他好文 时间:
2015-08-20 18:58:12
阅读次数:
157
分析,刚开始的时候想着用基数排序来做,看到网上的分析,直接应用STL中的排序函数,只要重新定义一个符合特殊要求的比较函数就行了,顿时觉得简单多了·····················
分类:
其他好文 时间:
2015-08-20 16:47:44
阅读次数:
149