DP.类似最大和。就是要记录正的和负的两种情况。class Solution {public: int maxProduct(int A[], int n) { vector positive(n); vector minus(n); int resu...
分类:
其他 时间:
2015-01-01 00:04:39
收藏:
0 评论:
0 赞:
0 阅读:
316
转载:http://www.ibm.com/developerworks/cn/linux/l-btloader/1. 引言在专用的嵌入式板子运行 GNU/Linux 系统已经变得越来越流行。一个嵌入式 Linux 系统从软件的角度看通常可以分为四个层次:1. 引导加载程序。包括固化在固件(firm...
分类:
其他 时间:
2015-01-01 00:04:29
收藏:
0 评论:
0 赞:
0 阅读:
311
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next...
分类:
其他 时间:
2015-01-01 00:04:09
收藏:
0 评论:
0 赞:
0 阅读:
336
每次只能有一组数字进行交换,最后达到逆序效果我们可以这样理解,我们总是希望每次将一个数摆到正确的位置上,那么这样一个数有顺时针逆时针两个方向移动的机会,我们总是挑移动次数少的一个方向那么我们排列前前一半数字,就将其逆时针排,这样次数比较少而后一半就顺时针排自己就能得到两个等差数列了 1 #inclu...
分类:
其他 时间:
2015-01-01 00:03:49
收藏:
0 评论:
0 赞:
0 阅读:
311
关于c++能做什么的解惑https://www.ptt.cc/bbs/Soft_Job/M.1352253161.A.D09.htmlhttp://subject.csdn.net/cplusplus/http://www.zhihu.com/question/20181597http://bill...
分类:
其他 时间:
2015-01-01 00:03:29
收藏:
0 评论:
0 赞:
0 阅读:
411
Given a string which contains only letters. Sort it by lower case first and upper case second.NoteIt's not necessary to keep the original order of low...
分类:
其他 时间:
2015-01-01 00:03:09
收藏:
0 评论:
0 赞:
0 阅读:
1306
题目:(Tree Stack)Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will ...
分类:
其他 时间:
2015-01-01 00:02:39
收藏:
0 评论:
0 赞:
0 阅读:
310
1 1、加载应用信息: 2 1.1、直接在controller里进行懒加载:(get方法) 3 1.1.1、先判断是否已经加载数据:if (array == nil) 4 1.1.2、先找到plist文件的路径:NSString *path = [[NSBundle mai...
分类:
其他 时间:
2015-01-01 00:01:49
收藏:
0 评论:
0 赞:
0 阅读:
349
老题目。两个栈。class MinStack { stack stk; stack minstk;public: void push(int x) { stk.push(x); if (minstk.empty() || minstk.top() >= ...
分类:
其他 时间:
2015-01-01 00:01:39
收藏:
0 评论:
0 赞:
0 阅读:
355
各种情况。有恶心的负数最值,用long long来做了。除此之外的情况下面都列出来了。/*1, 8 = 0.1251, 6 = 0.1(6)-50, 6 = -6.250, -3 = 0-1, -2147483648 = "0.0000000004656612873077392578125"*/ty...
分类:
其他 时间:
2015-01-01 00:01:29
收藏:
0 评论:
0 赞:
0 阅读:
375
本人的做法是转化成vector再处理,各种情况就比较简单了。class Solution {public: int compareVersion(string version1, string version2) { vector v1 = convert(version1); ...
分类:
其他 时间:
2015-01-01 00:01:19
收藏:
0 评论:
0 赞:
0 阅读:
366
全错位排列的介绍及其代码与算法题
分类:
其他 时间:
2015-01-01 00:01:09
收藏:
0 评论:
0 赞:
0 阅读:
386
题目链接:http://codeforces.com/problemset/problem/500/A题目意思:给出 n-1 个 cell,每个 cell 有一个值 ai,表示在这个编号为 i 的 cell,能到达i + ai 的cell,但不能反过来,即从 i+ai 到达i 这个 cell。问从第...
分类:
其他 时间:
2015-01-01 00:00:59
收藏:
0 评论:
0 赞:
0 阅读:
758
黑帮火并简单版。多个数的有另一篇文章。class Solution {public: int majorityElement(vector &num) { int size = num.size(); int major = 0; int count ...
分类:
其他 时间:
2015-01-01 00:00:29
收藏:
0 评论:
0 赞:
0 阅读:
474
1. 新建立空白解决方案,并在解决方案中新建项目,项目类型为:WCF服务应用程序。建立完成后如下图所示: 2.删除系统生成的两个文件IService1.cs与Service1.svc,当然你也可以直接在这两个自动生成的文件中编码。 3.添加自定义的WCF【服务文件】User.svc,此时vs20.....
分类:
其他 时间:
2015-01-01 00:00:19
收藏:
0 评论:
0 赞:
0 阅读:
355
二分,各种情况。class Solution {public: int findMin(vector &num) { int size = num.size(); int minVal = num[size-1]; findMinRe(num, 0, ...
分类:
其他 时间:
2015-01-01 00:00:09
收藏:
0 评论:
0 赞:
0 阅读:
360
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.entity.user.Us...
分类:
其他 时间:
2014-12-31 23:59:59
收藏:
0 评论:
0 赞:
0 阅读:
631
在DateUtils(d7)里,有如下几个现成的函数 function IncYear(const AValue: TDateTime; const ANumberOfYears: Integer = 1): TDateTime; // function IncMonth is in SysUtil...
分类:
其他 时间:
2014-12-31 23:59:39
收藏:
0 评论:
0 赞:
0 阅读:
620
Given two strings, find the longest common substring.Return the length of it.NoteThe characters in substring should occur continiously in original str...
分类:
其他 时间:
2014-12-31 23:59:19
收藏:
0 评论:
0 赞:
0 阅读:
758
在开发中,使用快捷键就像玩游戏时用的大招,这么爽的东西你能不用吗?各种新建shift + comand + n 新建项目option + command + n 新建分组command + n 新建文件搜索shift + command + o command + f控制tabcommand + t...
分类:
其他 时间:
2014-12-31 23:59:09
收藏:
0 评论:
0 赞:
0 阅读:
583