A Maximum in Table B Painting Pebbles C Sums of Digits D Restoring Numbers E Pretty Song F Progress Monitoring 总结 1. B题一开始有些马虎,没有读完题就开始做,结果理解错题意WA了一次(...
分类:
其他好文 时间:
2015-02-03 10:58:53
阅读次数:
118
1. Counting Sort doesn't work for negative number.2. Counting Sort assumes that each element is SMALL INTEGER.3. Time Complexity is O(Maximum value - ...
分类:
其他好文 时间:
2015-02-03 01:53:09
阅读次数:
130
Find the contiguous subarray within an array (containing at least onenumber) 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] has t...
分类:
其他好文 时间:
2015-02-02 23:16:28
阅读次数:
368
<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><linkrel="stylesheet" href="../../../ui/jquery.mobile-1.4.5/jquery.mo..
分类:
Web程序 时间:
2015-02-02 19:59:19
阅读次数:
246
A - Maximum in Table
纯递推。
代码如下:
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define LL __int64
#define pi acos(-1.0)
const int mod...
分类:
其他好文 时间:
2015-02-02 12:37:06
阅读次数:
135
原题地址二叉树的遍历代码:1 int maxDepth(TreeNode *root) {2 if (!root)3 return 0;4 return max(maxDepth(root->left), maxDepth(root->righ...
分类:
其他好文 时间:
2015-02-02 12:21:50
阅读次数:
132
A. Maximum in Table题意:给定一个表格,它的第一行全为1,第一列全为1,另外的数满足a[i][j]=a[i-1][j]+a[i][j-1],求这个表格中的最大的数a[n][n]即为最大的数#include #include #include #include using n...
分类:
其他好文 时间:
2015-02-01 12:03:20
阅读次数:
275
题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet...
分类:
编程语言 时间:
2015-02-01 10:46:16
阅读次数:
251
Maximum path sum II
Problem 67
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9...
分类:
编程语言 时间:
2015-01-31 13:06:41
阅读次数:
185
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line. 1 import java.util.HashMap; 2 import java.util.Itera...
分类:
其他好文 时间:
2015-01-30 21:04:34
阅读次数:
169