DescriptionOnce Bob took a paper stripe ofnsquares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negativ...
分类:
其他好文 时间:
2015-08-09 20:23:56
阅读次数:
207
DescriptionOnce Bob took a paper stripe ofnsquares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negativ...
分类:
其他好文 时间:
2015-08-09 20:13:24
阅读次数:
162
Implement int sqrt(int x).
Compute and return the square root of x.
1. 二分法:
用unsigned long long。最后返回值还要再检查一下。
class Solution {
public:
int mySqrt(int x) {
unsigned long long be...
分类:
其他好文 时间:
2015-08-09 18:50:31
阅读次数:
179
DescriptionOnce Bob took a paper stripe of n squares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negat...
分类:
其他好文 时间:
2015-08-08 16:16:30
阅读次数:
250
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matr...
分类:
其他好文 时间:
2015-08-08 14:52:24
阅读次数:
102
这题使用动态规划,基本想法是建立一张表table,table[i][j]就标志以点(i, j) 为右下角顶点的正方形最大边长,显然,可以通过table[i - 1][j - 1]来得到table[i][j]的值(正方形,只需要考虑对角的方向)。class Solution {public: i...
分类:
其他好文 时间:
2015-08-08 09:05:27
阅读次数:
167
DescriptionOnce Bob took a paper stripe ofnsquares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negativ...
分类:
其他好文 时间:
2015-08-07 22:15:50
阅读次数:
127
原题:DescriptionOnce Bob took a paper stripe ofnsquares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly nega...
分类:
其他好文 时间:
2015-08-07 22:11:14
阅读次数:
139
DescriptionOnce Bob took a paper stripe ofnsquares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negativ...
分类:
其他好文 时间:
2015-08-07 22:03:30
阅读次数:
235
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matr...
分类:
其他好文 时间:
2015-08-07 21:54:10
阅读次数:
116