码迷,mamicode.com
首页 >  
搜索关键字:const    ( 26295个结果
POJ3259 Wormholes 【Bellmanford判断是否存在负回路】
很简单的bellmanford题目,这里比较详细:http://blog.csdn.net/lyy289065406/article/details/6645790 直接代码 #include #include #include #include #include #include using namespace std; const int SIZE=11111; const i...
分类:其他好文   时间:2014-06-03 04:10:45    阅读次数:182
ural 1076 KM求最小权匹配
贴模板~KM算法引进了顶标函数,不断缩小这个顶标来让相等子图的可能范围扩大#include#include//KM 复杂度O^3 using namespace std;const int N=200;int lx[N],ly[N];//顶标函数int w[N][N];//图bool vix[N],...
分类:其他好文   时间:2014-06-02 21:53:12    阅读次数:334
cocos2dx遇到的一些坑
针对2.x1、CCSprite无法直接用文件名更换图片,可以添加如下函数bool CCSprite::setWithFile(const char *pszFilename){ CCAssert(pszFilename != NULL, "Invalid filename for sprite")....
分类:其他好文   时间:2014-06-02 20:41:58    阅读次数:325
北京邀请赛 B. Beautiful Garden
题意:给你坐标和n个点,求最少移动的点使得n个点成等差数列 思路:既然要成等差数列,那么最起码有两个点是不动的,然后枚举这两个点中间的点的个数,最近水的要死,看了队友的代码做的 #include #include #include #include #include #include using namespace std; const double eps = 1e-9; con...
分类:其他好文   时间:2014-06-01 10:53:02    阅读次数:193
匈牙利算法 求最大匹配
不断找增广路,直到没有增广路,每找到一条增广路匹配数就加1 //hungary const int X=100,Y=100;int match[Y];// initial to -1bool vis[Y];int g[X][Y];bool dfs(int x){ for(int y=1;y<=Y;y...
分类:其他好文   时间:2014-05-31 20:49:41    阅读次数:247
【USACO 1.2.2】方块转换
【问题描述】一块N x N(1 2 #include 3 #include 4 #include 5 #include 6 #include 7 const int maxn=15; 8 const int INF=0x7fffffff; 9 using namespace...
分类:其他好文   时间:2014-05-31 19:38:46    阅读次数:343
C++ 转型动作 尽量避免 以及 那些意想不到的威胁
看完EffectiveC++的关于转型的章节,顿时认为周围的代码都处在悬崖边上~~C的旧式转型:inta = 10; double b = (double)a;对于C++的四种转型函数,const_cast去掉对象的常量性(仅仅此一个操作符有此功能!)dynamic_cast一般用于继承体系中某对象...
分类:编程语言   时间:2014-05-31 19:20:35    阅读次数:288
string::replace
函数原型:string& replace (size_t pos, size_t len, const string& str);具体请查阅C++开发文档。只贴示例代码。示例代码:// replacing in a string#include #include int ...
分类:其他好文   时间:2014-05-31 18:35:32    阅读次数:202
[C/C++基础] C语言常用函数sprintf和snprintf的使用方法
Sprintf函数声明:int sprintf(char *buffer, const char *format [, argument1, argument2, …])用途:将一段数据写入以地址buffer开始的字符串缓冲区所属库文件: 参数:(1)buffer,将要写入数据的起始地址;(2)fo...
分类:编程语言   时间:2014-05-31 18:30:24    阅读次数:255
poj 1635
有根树同构。参考论文《hash在。。。。》 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 10 const int leaf_hash=2099;...
分类:其他好文   时间:2014-05-31 18:21:24    阅读次数:187
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!