码迷,mamicode.com
首页 >  
搜索关键字:has-a    ( 11077个结果
LeetCode: Search a 2D Matrix [074]
【题目】 Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first integer of each row is greater than the last integer of the previous ...
分类:其他好文   时间:2014-06-05 08:28:43    阅读次数:321
POJ 3259 Wormholes (图论---最短路 Bellman-Ford || SPFA)
链接:http://poj.org/problem?id=3259 Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path t...
分类:其他好文   时间:2014-06-05 05:26:33    阅读次数:240
LeetCode: Text Justification [068]
【题目】 Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad ...
分类:其他好文   时间:2014-06-04 22:37:46    阅读次数:389
HDU2717-Catch That Cow
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,0...
分类:其他好文   时间:2014-06-03 05:30:23    阅读次数:394
USACO·2012·Feb Bronze && 2009·Open Gold
Rope Folding [Brian Dean, 2012]时间限制: 1 Sec 内存限制: 128 MB题目描述Farmer John has a long rope of length L (1 =f(i)的最大i值,递归即可。Work Scheduling [Richard Peng, ....
分类:其他好文   时间:2014-06-02 17:40:21    阅读次数:1039
POJ2586——Y2K Accounting Bug
Y2K Accounting BugDescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual rep...
分类:其他好文   时间:2014-06-02 00:57:42    阅读次数:386
【LeetCode】Merge Sorted Array
Merge Sorted ArrayGiven two sorted integer arrays A and B, merge B into A as one sorted array.Note: You may assume that A has enough space (size that ...
分类:其他好文   时间:2014-06-01 12:04:32    阅读次数:175
【leetcode】 Longest Substring Without Repeating Characters
题目: 给定一个字符串,返回该串没有重复字符的最长子串。 分析: 1)子串:子串要求是连续的。 2)无重复,出现重复就断了,必须从新的位置开始。而新的位置就是重复字符第一次出现位置的下一个位置。 3)整个串可能没有一处重复。 那么,为了找出当前访问的字符是否出现过,要怎么做呢?当然是hash,O(1)的时间,而且既然是字符, 定义个255的hash table 就可以了,has...
分类:其他好文   时间:2014-06-01 10:48:31    阅读次数:206
LeetCode: Merge Sorted Array [088]
【题目】 Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are...
分类:其他好文   时间:2014-06-01 09:21:16    阅读次数:292
poj 2769 Reduced ID Numbers(memset使用技巧)
Description T. Chur teaches various groups of students at university U. Every U-student has a unique Student Identification Number (SIN). A SIN s is an integer in the range 0 ≤ s ≤ MaxSIN with MaxS...
分类:其他好文   时间:2014-06-01 07:40:18    阅读次数:248
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!