码迷,mamicode.com
首页 >  
搜索关键字:es6 let const    ( 43838个结果
HDU 1693 Eat the Trees
插头DP,多条回路求回路数。 可以当作模版来记。注重理解轮廓线。 #include #include #include #include using namespace std; const int HASH=10007; const int STATE=5000; //状态数 const int MAXD=15; int code[MAXD],maze[MAXD][MAXD];...
分类:其他好文   时间:2014-05-15 11:23:33    阅读次数:344
uva 101 - The Blocks Problem
用 栈 stack 来模拟 题目意思:http://blog.csdn.net/mobius_strip/article/details/12765319 下面的代码有坑,输出格式需要调。 #include #include #include #include #include using namespace std; const int maxn=25+5; stacks[maxn]; i...
分类:其他好文   时间:2014-05-15 07:22:04    阅读次数:273
ZOJ 3640 Help Me Escape
OJ题目:click here~~ 题目分析:有n条路径逃出洞穴,第i条路径有一个难度值ci。某人开始有战斗值f,每天随机选择某一条路径想要逃出。只要此时的 f 大于所选路径的ci,就能花费ti的天数逃出。这里。否则,等待明天再试吧,但是战斗值能增加ci。求逃出的期望天数。 设dp[ i ] 为战斗值为i时,逃出的期望天数。详细解释见代码。 AC_CODE int const maxn =...
分类:其他好文   时间:2014-05-15 06:38:40    阅读次数:406
hdu AC me
/* * hdu AC Me * date 2014/5/13 * state AC */ #include #include #include #include using namespace std; const int MAXN=100001; char Arr[MAXN]; int cnt[26]; int main() { //cout << "Hello wor...
分类:其他好文   时间:2014-05-15 06:16:24    阅读次数:247
C++ Primer 学习笔记_70_面向对象编程 --纯虚函数、容器与继承
面向对象编程--纯虚函数、容器与继承I.纯虚函数 在函数形参后面写上 =0 以指定纯虚函数:class Disc_item : public Item_base { public: double net_price(size_t) const = 0; //指定纯虚函数 }; 将函数定义为纯虚函数能够说明,该函数为后代类型提供了可以覆盖的接口,但是这个类的版本绝不会调用。重要的是,用户将不...
分类:编程语言   时间:2014-05-15 05:50:43    阅读次数:316
备忘之 拷贝构造函数
//拷贝构造函数,什么时候算是 “合适的时候”,才会合成呢~~~ #include using namespace std; class A { public:     A(char *_str):str(_str),x(0){}     //A(const A&a){cout     //如果没有定义的话,对于类A来说,编译器依然不会合成,因为此时的对象之间的...
分类:其他好文   时间:2014-05-15 05:11:13    阅读次数:334
HDU 4285 circuits
插头DP。 题目要求构造出K条回路的方案数,而且不能出现环套环。 Sol:通过增加标记为来记录形成的回路数,假如不形成环的话就是在形成新的环路,此时,两边的插头个数要为偶数。 #include #include #include #include using namespace std; const int MAXD=15; const int STATE=1000010; const i...
分类:其他好文   时间:2014-05-15 03:53:23    阅读次数:272
HDU 3377 Plan
插头DP。 从左上角到右下角,每个格子都有Val,每个格子只能经过一次,可以不经过,求最大的分数之和。 #include #include #include #include using namespace std; const int MAXD=15; const int HASH=10007; const int STATE=1000010; int N,M; int maz...
分类:其他好文   时间:2014-05-15 03:43:02    阅读次数:175
UVa 10308 Roads in the North 树的直径
题目来源:UVa 10308 Roads in the North 题意:求距离最远的2点之间的距离 思路:裸的树的直径 或者树形DP #include #include #include using namespace std; const int maxn = 100010; struct node { int to, w; node(){} node(int to, int...
分类:其他好文   时间:2014-05-15 03:37:18    阅读次数:295
HDU 2222-Keywords Search-AC自动机模版题
纯粹的模版。。。 学习模版总会是一个快乐的过程。。。。 #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const int...
分类:其他好文   时间:2014-05-15 03:02:53    阅读次数:275
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!