码迷,mamicode.com
首页 >  
搜索关键字:requestdispatcher forward include    ( 87212个结果
uva 616 - Coconuts, Revisited(数学)
题目链接:uva 616 - Coconuts, Revisited 题目大意:题目背景和uva 10726是一样的,只是这道题目是给出n,表示椰子的个数,并且猴子的个数为1,问说是否能找到满足的人数,并且要求人数尽量大。 解题思路:枚举人数,然后根据uva 10726推出的公式去求出最后剩下的椰子是否满足平分等判断。 #include #include #inc...
分类:其他好文   时间:2014-07-22 23:05:55    阅读次数:320
UVA 10981 - String Morphing(记忆化搜索)
题目链接:10981 - String Morphing 题意:给定开始的字符串,要求根据表格变化成一个字符串,问变化的顺序(注意,不一定要最少步数) 思路:记忆化搜索,用map来存字符串的状态,一开始按最少步数去做TLE,其实只要找到一个符合的就可以了 代码: #include #include #include #include #include using namespac...
分类:其他好文   时间:2014-07-22 23:03:54    阅读次数:293
A*算法的寻路中的应用——无阻挡
按照之前转载的文章,自己先实现了下,表示还是很多坑: #include "stdio.h" #include #include #include #include using namespace std; int neigor[][2] ={ {-1, -1}, {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0} }...
分类:其他好文   时间:2014-05-01 18:03:27    阅读次数:320
POJ - 2926 Requirements
题意:多维的曼哈顿最远距离 思路:做了1,2,3维的,其实就是枚举所有绝对值的可能的表达式 #include #include #include #include using namespace std; const int MAXN = 100005; const int M = 5; const double inf = 1e200; struct node{ double x...
分类:其他好文   时间:2014-05-01 17:31:01    阅读次数:283
hdu 1160 FatMouse's Speed
题目:寻找最长上升自序列。 代码: #include #include #include #include using namespace std; struct node { int w,s; //重量,速度 int num; //编号 int t; //用来记录当前编号...
分类:其他好文   时间:2014-05-01 17:17:32    阅读次数:285
cocos2d-x3.0 ScrollView
.h #include "cocos2d.h" #include "cocos-ext.h" #include "ui/CocosGUI.h" #include "cocostudio/CocoStudio.h" USING_NS_CC; USING_NS_CC_EXT; using namespace ui; .cpp layout = Layout::crea...
分类:其他好文   时间:2014-04-30 22:33:39    阅读次数:382
c++调用基类的构造函数(模板类)
代码如下 #include #include #include using namespace std; template class Base { public: Base(T name); virtual void toString(); protected: T id; }; template Base::Base(T n) { printf("B...
分类:编程语言   时间:2014-04-30 22:27:39    阅读次数:450
结构体中的指针与零长度数组
0长度的数组在ISO C和C++的规格说明书中是不允许的,但是由于gcc 预先支持C99的这种玩法,所以,“零长度数组”在gcc环境下是合法的。 先看下面两个例子。 pzeroLengthArray.c #include struct str { int len; char *s; }; struct foo { struct str *a; }; int main() {...
分类:其他好文   时间:2014-04-30 22:22:39    阅读次数:300
Codeforces 1
A. Theatre Square:         题目地址:http://codeforces.com/contest/1/problem/A         题目大意:n*m的长方形用a*a的正方形覆盖,允许超出长方形,问需要几个正方形。         算法讨论:计算长和宽分别需要几个a,相乘即可。         Code: #include #include using...
分类:其他好文   时间:2014-04-30 22:15:39    阅读次数:272
红黑树容器实现(带迭代器)
上一篇文章是纯粹地实现了红黑树,但是在STL中,红黑树容器是需要迭代器实现的。故将上一篇文章改进后实现红黑树容器。 #ifndef ITERATOR_RB_TREE_H_INCLUDED #define ITERATOR_RB_TREE_H_INCLUDED #include"my_iterator_base.h" /* ** iterator_rb_tree.h 红黑树地泛型容器地迭代器 与...
分类:其他好文   时间:2014-04-29 13:45:21    阅读次数:506
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!