分析:两个人都足够聪明,因此每个阶段都拿最大的。dp[sa][ea][sb][eb]分别表示区间1的开始为sa,结束为ea,区间2的开始为sb,结束为eb时能拿到的最大值。之后分别从四个方向上拿,是个搜索的过程。
[cpp] view
plaincopyprint?
#include
using namespace std;
...
分类:
其他好文 时间:
2015-06-02 22:10:58
阅读次数:
164
题目:Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", return true.Whens...
分类:
其他好文 时间:
2015-06-02 19:59:54
阅读次数:
112
代码从polarssl中扒来的,略作改动,md5.h & md5.cpp 如下 1 #ifndef POLARSSL_MD5_H 2 #define POLARSSL_MD5_H 3 4 #include 5 #include 6 7 class md5 8 { 9 public: 1...
分类:
其他好文 时间:
2015-06-02 19:59:20
阅读次数:
197
二叉树排序// 二叉树排序.cpp : 定义控制台应用程序的入口点。
//#include "stdafx.h"
#include
#include
#includestruct data{
int num;
struct data* lbaby, *rbaby;
}*root, *tree, *leaf;void find...
分类:
编程语言 时间:
2015-06-02 18:06:20
阅读次数:
110
基数排序// 基数排序.cpp : 定义控制台应用程序的入口点。
//#include "stdafx.h"
#include
#includevoid main()
{
int data[10] = {75,23,98,44,57,12,29,64,38,82};
int i, j, k = 0, n = 1, lsd, temp[10][1...
分类:
编程语言 时间:
2015-06-02 18:05:51
阅读次数:
141
飞机订票系统// 飞机订票系统.cpp : 定义控制台应用程序的入口点。
//#include "stdafx.h"
#include
#include
#include
#include
#define N 2typedef struct plane
{
char ID[10];
char Start_...
分类:
其他好文 时间:
2015-06-02 18:00:42
阅读次数:
215
1、打开终端,然后进入到cocos2dx-3.0安装包目录下的tools/project-creator目录2、运行命令:python create_project.py -n 项目名称 -k 项目包名 -l cpp -p 项目位置比如:python create_project.py -n Rpg...
分类:
其他好文 时间:
2015-06-02 17:32:45
阅读次数:
114
http://c.biancheng.net/cpp/view/6998.html打开文本编辑器,新建一个文件,扩展名为sh(sh代表shell),扩展名并不影响脚本执行,见名知意就好,如果你用php写shell 脚本,扩展名就用php好了。输入一些代码:#!/bin/bashecho "Hello...
分类:
系统相关 时间:
2015-06-02 17:15:13
阅读次数:
124
题目: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-06-02 16:51:05
阅读次数:
117
题目:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.代码:class Solution {public: ...
分类:
其他好文 时间:
2015-06-02 12:45:56
阅读次数:
119