码迷,mamicode.com
首页 >  
搜索关键字:const 底层const 顶层const    ( 26295个结果
POJ - 1458 Common Subsequence
最长公共子序列求解问题。 1 #include 2 #include 3 const int maxn=1000; 4 char s1[maxn],s2[maxn]; 5 int c[maxn][maxn]; 6 int main() 7 { 8 while(scanf("%s%s",s1,...
分类:其他好文   时间:2014-07-19 14:30:43    阅读次数:223
ACM3371超时问题
这的确也是个大坑;其实在这是到很简单的最小生成树的题目,但是数据量却很大;用G++提交会超时,用C++不会超时,而且速度超快;又长见识了。可惜长得不是做题的能力,而是知道它到底有多坑。 1 #include 2 #include 3 using namespace std; 4 const int ...
分类:其他好文   时间:2014-07-19 11:17:24    阅读次数:194
HDU - 1087 Super Jumping! Jumping! Jumping!
还算是简单的DP问题,状态方程也不难。刚开始一看还以为是最长连续序列的最大值,想了老半天想不出状态方程。 1 #include 2 #include 3 #define doumax(a,b) (a>b?a:b) 4 const int maxn=1000+5; 5 int a[maxn],d[ma...
分类:其他好文   时间:2014-07-19 09:22:04    阅读次数:147
线段树(自敲:建树,查找最大值,更新结点值)
HDU1754 1 #include 2 3 using namespace std; 4 5 const int MaxSIZE = 2e6 + 10; 6 7 typedef struct { 8 int Max ; 9 int left, right ...
分类:其他好文   时间:2014-07-19 09:14:48    阅读次数:250
Codeforces Round #FF
A.DZY Loves Hash hash函数 h(x) = x % p 输出第一次冲突的位置#include#include#includeusing namespace std;const int maxn = 4000;int p, n;bool inhash[maxn];int ma...
分类:其他好文   时间:2014-07-19 09:09:32    阅读次数:226
hdu 1236 排名
结构体定义没搞明白,一直WA,终于AC了,真是高兴呀 代码如下: #include #include #include struct student { char id[30]; int score; }person[1001]; int cmp(const void *a,const void *b) { struct student *aa=(struct studen...
分类:其他好文   时间:2014-07-19 08:15:25    阅读次数:194
UVA 1156 - Pixel Shuffle(模拟+置换)
UVA 1156 - Pixel Shuffle 题目链接 题意:根据题目中的变换方式,给定一串变换方式,问需要执行几次才能回复原图像 思路:这题恶心的一比,先模拟求出一次变换后的对应的矩阵,然后对该矩阵求出所有循环长度,所有循环长度的公倍数就是答案 代码: #include #include const int N = 1100; int t, n, g[N]...
分类:其他好文   时间:2014-07-19 08:15:10    阅读次数:307
cocos2d-x 求相交矩阵
cocos2d-x有判断矩阵相交的方法 CCRect::intersectsRect(CCRect& rect)但可惜没有提供求两个相交矩阵的方法,我作了总结,代码如下: CCRect Tools::intersectsRect(const CCRect &rectA, const CCRect &rectB) { CCPoint ori; //左下角顶点 cocos2dx的CC...
分类:其他好文   时间:2014-07-19 08:06:10    阅读次数:266
hdu 1251 字典树模板题 ---多串 查找单词出现次数
这道题题目里没有给定数据范围 我开了2005  疯狂的WA 然后开了50000, A掉  我以为自己模板理解错  然后一天没吃饭,饿得胃疼还是想着把这题A掉再去吃,谁知居然是这种问题,,,呵呵~~~ #include #include #include #include using namespace std; const int tk=26; const int t...
分类:其他好文   时间:2014-07-19 08:05:06    阅读次数:196
const对象默认为文件的局部变量
const 定义的对象为一个常量不能被修改。这个想必大家都知道。 这里只是介绍const对象默认为文件的局部变量         当一个非const变量在一个c或cpp文件中为全局时,它在整个程序中都可以访问。我们在其他的c或cpp文件要用到这个变量,只需要在文件做合适的声明就能使用。 例如: main.cpp 中全局变量bufsize #include using namesp...
分类:其他好文   时间:2014-07-19 08:02:48    阅读次数:148
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!