题目链接:点击打开链接
题意:
给定n*m的矩阵,可以在矩阵中画出题目图片里黑色的线条。
任选一个点,左下右上的顺序走,走出图里的情况。使得走过的数字和最大,问最大的和。
思路:
点击打开链接
题解比较详细了
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.Pr...
分类:
其他好文 时间:
2015-03-11 23:27:17
阅读次数:
164
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ...
分类:
其他好文 时间:
2015-03-11 23:05:38
阅读次数:
170
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if yo...
分类:
其他好文 时间:
2015-03-11 21:40:22
阅读次数:
126
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-03-11 21:29:40
阅读次数:
112
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
124 Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the belo...
分类:
其他好文 时间:
2015-03-11 14:55:12
阅读次数:
124
求二叉树的最大深度/** * Definition for binary tree * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ int m...
分类:
其他好文 时间:
2015-03-10 23:06:11
阅读次数:
160
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,...
分类:
其他好文 时间:
2015-03-10 19:07:17
阅读次数:
126
学习lua不得不了解其方法或者说语法的特性,比如:多值返回function maximum (a) local mi = 1 -- maximum index local m = a[mi] -- maximum value for i,val in ipairs(a) do ...
分类:
移动开发 时间:
2015-03-10 18:44:37
阅读次数:
150
题目链接:Codeforces 484B Maximum Value题目大意:给定一个序列,找到连个数ai和aj,ai%aj尽量大,而且ai≥aj解题思路:类似于素数筛选法的方式,每次枚举aj,然后枚举k,每次用二分找到小于k?aj而且最大的ai,维护答案,过程中加了一些剪枝。#include #i...
分类:
其他好文 时间:
2015-03-10 13:37:12
阅读次数:
182
题意:给你一个矩阵,问你只变动行,能到到最大面积的全为‘1’ 的矩阵。解题思路:先一行一行的求出到了这一列最长连续的1有多少,然后一列一列先hash 然后求 最大值 ,发现%1d好慢。解题代码: 1 // File Name: 375b.cpp 2 // Author: darkdream 3 //...
分类:
其他好文 时间:
2015-03-09 22:15:34
阅读次数:
213