码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
GeeksforGeeks - Adjacency List邻接矩阵C代码
邻接矩阵的图示: 构建一个这样的无向邻接矩阵。 参考网站: http://www.geeksforgeeks.org/graph-and-its-representations/ 这里写了个类,增加删除图的操作。 #pragma once #include #include class AdjListGraph { struct Node { int dest; ...
分类:其他好文   时间:2014-05-11 22:44:20    阅读次数:378
c++ vector
vector类为内置数组提供了一种替代表示,与string类一样 vector 类是随标准 C++引入的标准库的一部分 ,为了使用vector 我们必须包含相关的头文件  : #include 使用vector有两种不同的形式,即所谓的数组习惯和 STL习惯。 一、数组习惯用法 1. 定义一个已知长度的 vector : vector ivec( 10 );  //...
分类:编程语言   时间:2014-05-11 22:21:45    阅读次数:415
拓扑排序
问题:给定几组单向边,判断是否可以拓扑排序。 输入:n   全局变量,表示点数            g   全局变量,g[i]表示从点 i 连出去的边 输出:返回对给定的图,是否可以拓扑排序。             L全局变量,拓扑排序的结果   #include #include #include #include #include using namespa...
分类:其他好文   时间:2014-05-11 21:14:00    阅读次数:342
解决linux下cocos2dx不能播放声音
cocos2dx2.2.1在linux下引用#include "SimpleAudioEngine.h",报错找不到该文件。 修改makefile文件,添加 SHAREDLIBS += -lcocosdenshion COCOS_LIBS +=$(LIB_DIR)/linux/release/libcocosdenshion.so 并将cocos2d-x-2.2.1/CocosDe...
分类:系统相关   时间:2014-05-11 21:12:01    阅读次数:449
SPOJ 4487. Can you answer these queries VI splay
题目链接:点击打开链接 题意比较明显,不赘述。 删除时可以把i-1转到根,把i+1转到根下 则i点就在 根右子树 的左子树,且只有i这一个 点 #include #include #include #include using namespace std; #define N 300500 #define inf 10000000 #define L(x) tree[x].ch[0] #d...
分类:其他好文   时间:2014-05-11 21:05:52    阅读次数:365
HDU 4027 Can you answer these queries? 线段树裸题
题意: 给定2个操作 0、把区间的每个数sqrt 2、求和 因为每个数的sqrt次数很少,所以直接更新到底,用个标记表示是否更新完全(即区间内的数字只有0,1就不用再更新了) #include #include #include #include #include #include #include #include using namespace std; #define N 1000...
分类:其他好文   时间:2014-05-11 21:02:45    阅读次数:325
UVA 417 - Word Index(数论)
题意:417 - Word Index 题意:每个字符串按题目中那样去映射成一个数字,输入字符串,输出数字 思路:这题还是比较水的,由于一共只有83000多个数字,所以对应一个个数字去映射就可以了,注意字符串进位的情况处理即可 代码: #include #include #include #include using namespace std; char str[10]; ma...
分类:其他好文   时间:2014-05-11 20:49:23    阅读次数:428
图的深度优先遍历--邻接表实现
这里用邻接表实现图的深度优先遍历,采用递归实现。 #include using namespace std; #define VERTEXNUM 5//结点数 struct edgenode { int to; int weight; // 边的权值 edgenode *next; }; struct vnode { int from...
分类:其他好文   时间:2014-05-11 20:46:16    阅读次数:519
九度 1351 只出现一次的数
#include #include using namespace std; #ifdef ONLINE_JUDGE #define FINPUT(file) 0 #define FOUTPUT(file) 0 #else #...
分类:其他好文   时间:2014-05-11 20:36:05    阅读次数:337
九度 1201
#include #include using namespace std; #ifdef ONLINE_JUDGE #define FINPUT(file) 0 #define FOUTPUT(file) 0 #else ...
分类:其他好文   时间:2014-05-11 20:30:57    阅读次数:308
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!