码迷,mamicode.com
首页 >  
搜索关键字:max value    ( 60798个结果
【LeetCode】- Search Insert Position(查找插入的位置)
[ 问题: ] Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in th...
分类:其他好文   时间:2014-07-22 23:01:15    阅读次数:270
Java中Integer类的方法
字段摘要staticintMAX_VALUE 保持 int 类型的最大值的常量可取的值为 231-1。staticintMIN_VALUE 保持 int 类型的最小值的常量可取的值为 -231。staticintSIZE 以二进制补码形式表示 int 值的位数。staticClassTYPE ...
分类:编程语言   时间:2014-05-12 15:49:08    阅读次数:423
Activity之间的信使--Bundle
两个Activity之间的传参的具体做法如下: 1.新建一个Bundle类 Bundle bundle=new Bundle(); 2.向Bundle类中放入数据(类似于map) bundle.putString("key" ," value"); 3.新建一个intent对象,并将该bund...
分类:其他好文   时间:2014-05-06 09:05:48    阅读次数:349
WCF Rest Json
1、定义ServiceContract及实现 [ServiceContract] public interface IMemberService { [OperationContract] string GetData(int value); ...
分类:Web程序   时间:2014-05-06 01:03:39    阅读次数:383
leetcode: Search a 2D Matrix
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:其他好文   时间:2014-05-02 10:41:53    阅读次数:267
leetcode: Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:其他好文   时间:2014-05-02 09:54:11    阅读次数:269
String构造器中originalValue.length>size 发生的情况
最近在看Jdk6中String的源码的时候发现String的有个这样的构造方法,源代码内容如下: public String(String original) { int size = original.count; char[] originalValue = original.value; char[] v; if (originalValue.length > size) { ...
分类:其他好文   时间:2014-05-02 06:34:52    阅读次数:237
poj 3342(树形dp)
题意:在一个公司中要举办一个聚会,每一个员工有一个奉献值。为了和谐规定直接上下级不能一起出席。让你找出奉献值之和最大为多少。思路:dp[v][1]表示当前结点选,能获得的最大奉献值,dp[v][0]表示当前节点不选能获得的最大奉献值。状态转移:dp[v][0] = max(dp[v][0], ∑ma...
分类:其他好文   时间:2014-05-01 22:30:47    阅读次数:485
struts2国际化
一、步骤:1.在struts配置文件中添加说明;2.编写配置文件二、代码:1、在元素中添加 2.在src目录下添加国际化配置文件xxx_zh_CN.properties(中文)/xxx_en_US.properties
分类:其他好文   时间:2014-05-01 19:57:20    阅读次数:264
HDU 3415 Max Sum of Max-K-sub-sequence 最长K子段和
链接:http://acm.hdu.edu.cn/showproblem.php?pid=3415 题意:给出一个数环,要找出其中9长度小于等于K的和最大的子段。 思路:不能采用最暴力的枚举,题目的数据量是10^5,O(N^2)的枚举回去超时,本题采用的很巧妙的DP做法,是用单调队列优化的DP。 运用的是STL的deque,从i:1~a找到以其中以i为尾的符合条件的子段,并将i本身放入双向队...
分类:其他好文   时间:2014-05-01 08:32:53    阅读次数:324
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!