一个简单而经典的dp;若数组a:1 3 2 4则数组b:1 4 3 8b[i]每一个都要向前找 合法 的最大b[x]值加上当前的a[i];如b[2]=b[0]+a[2];#include using namespace std;int a[1001];int b[1001];int max_b(in...
分类:
其他好文 时间:
2014-07-19 19:32:30
阅读次数:
182
1. 顺序容器的初始化操作1.1 顺序容器(vector,list,deque)的五种初始化方法,以 vector 为例。#include #include #include using namespace std;int main(int argc, const char *argv[]){ .....
分类:
编程语言 时间:
2014-07-19 19:27:08
阅读次数:
278
#include #include using namespace std;typedef struct Node{ Node* lchild; Node* rchild; int data;}BNode,BTree;void visit(Node*);void inorder(B...
分类:
其他好文 时间:
2014-07-19 19:26:40
阅读次数:
226
打印如下形状的东西:刚开始看了半天,愣住了,然后才知道了如何做。一:先来点简单的 就先打印了如下:这样的还是挺容易的,for循环打印每一行,每一行打印出特定多的,只是在for循环内部确定下一次是要增加打印的个数还是减少,代码:#include using namespace std;int m...
分类:
其他好文 时间:
2014-07-19 19:17:03
阅读次数:
180
1506题意:给你连续的直方图(底边边长为1),求连续的矩阵面积。
对每个直方图,分别向左向右进行扩展。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define...
分类:
其他好文 时间:
2014-07-18 23:12:40
阅读次数:
290
#include
#include
using namespace std;
void hello()
{
cout<<"hello kitty"<<endl;
}
int main()
{
std::thread t(hello);
t.join();
return 0;
}...
分类:
编程语言 时间:
2014-07-18 23:03:18
阅读次数:
343
题目链接:点击打开链接
题意:
给定2个字符串
选择第一个字符串的其中一个字母删除,使得2个字符串完全相同
问哪些位置可以选
思路:
hash求前缀后缀,然后枚举位置
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
...
分类:
其他好文 时间:
2014-07-18 22:27:50
阅读次数:
210
一个天天跟c#奋斗的苦逼c++程序员 改自己以前代码的时候发现有如下几行.
char szPath[MAX_PATH] = {0};
GetModuleFileNameA(NULL,szPath,sizeof(szPath));
std::string strPath = szPath;
std::string strDir = strPath.substr(0,strPa...
分类:
其他好文 时间:
2014-07-18 22:24:31
阅读次数:
187
点击打开链接
题意:略
解析:枚举等级,Dijkstra
#include
#include
#include
using namespace std;
const int maxn = 1005;
#define INF 0xfffffff
int mapp[ maxn ][ maxn ], num[ maxn ][ maxn ], vis[ maxn ], dis[ maxn ...
分类:
其他好文 时间:
2014-07-18 22:00:11
阅读次数:
235
/** \brief poj 1502--Dijkstra
*
* \ date 2014/7/15
* \ state AC
* *
*/
#include
#include
#include
#include
using namespace std;
#define inf 0x03f3f3f3f
const int MAXN=101;
int n;
int co...
分类:
其他好文 时间:
2014-07-18 21:22:31
阅读次数:
192