码迷,mamicode.com
首页 >  
搜索关键字:bfs 优先队列 stl    ( 13177个结果
通读《STL源码剖析》之后的一点读书笔记
[QQ群: 189191838,对算法和C++感兴趣可以进来] 直接逼入正题。Standard Template Library简称STL。STL可分为容器(containers)、迭代器(iterators)、空间配置器(allocator)、配接器(adaptors)、算法(algorit...
分类:其他好文   时间:2014-05-14 03:55:43    阅读次数:273
[leetcode]Binary Tree Level Order Traversal @ Python
原题地址:http://oj.leetcode.com/problems/binary-tree-level-order-traversal/题意:二叉树的层序遍历的实现。解题思路:二叉树的层序遍历可以用bfs或者dfs来实现。这里使用的dfs实现,代码比较简洁。实际上,二叉树的先序遍历就是dfs实...
分类:编程语言   时间:2014-05-14 03:25:59    阅读次数:428
Linux Android 开发环境搭建
由于Android本身就是linux,为了避免各种不必要的坑,所以在linux下开发Android.当然不熟悉 linux 的,选择 windows 开发也是一样,没有任何问题,个人习惯就好.说一下我的开发环境, ubuntu 14.04(这个是最新的STL), JDK 1.7.0. 首先是 ...
分类:移动开发   时间:2014-05-14 01:59:42    阅读次数:374
Codeforces 429B Working out bfs构造
题目链接:点击打开链接 题意:给定n*m的矩阵 有一个人a从左上角↖走到右下角↘,只能↓或→走 另一个人b从左下角↙走到右上角↗,只能↑或→走 使得2个人的路径有且仅有一个格子是相交的。 统计2个人的权值和(相交格子的权值和不计) 问最大的权值和是多少。 思路: 首先转换一下题意,也就是找一个格子与4个角落连不相交的线。 我们观察相交的那个格子,那个格子的上下左右必然对应着一个角...
分类:其他好文   时间:2014-05-13 07:51:44    阅读次数:280
HDU 4022 Bombing STL 模拟题
手动模拟。。 #include #include #include #include #include #include #include #include using namespace std; #define N 10100 #define inf 1000000010 mapx,y; struct X{ int x,y; bool operator<(const X&a)const{...
分类:其他好文   时间:2014-05-13 07:29:10    阅读次数:294
HDU 4028 The time of a day STL 模拟题
暴力出奇迹。。 #include #include #include #include #include #include #include #include using namespace std; #define ll __int64 #define N 42 ll n,m,ans; ll Gcd(ll x,ll y){ if(x>y)swap(x,y); while(x){ y%=...
分类:其他好文   时间:2014-05-12 23:11:06    阅读次数:445
c++ vector
vector类为内置数组提供了一种替代表示,与string类一样 vector 类是随标准 C++引入的标准库的一部分 ,为了使用vector 我们必须包含相关的头文件  : #include 使用vector有两种不同的形式,即所谓的数组习惯和 STL习惯。 一、数组习惯用法 1. 定义一个已知长度的 vector : vector ivec( 10 );  //...
分类:编程语言   时间:2014-05-11 22:21:45    阅读次数:415
ZOJ 1151 Word Reversal反转单词 (string字符串处理)
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=151 For each list of words, output a line with each word reversed without changing the order of the words. This problem contains multi...
分类:其他好文   时间:2014-05-11 22:20:43    阅读次数:443
关联容器(底层机制) — hashtable
C++ 11已将哈希表纳入了标准之列。hashtable是hash_set、hash_map、hash_multiset、hash_multimap的底层机制,即这四种容器中都包含一个hashtable。 解决碰撞问题的办法有许多,线性探测、二次探测、开链等等。SGI STL的hashtable采用的开链方法,每个hash table中的元素用vector承载,每个元素称为桶(bucke...
分类:其他好文   时间:2014-05-11 21:07:54    阅读次数:522
ZOJ 2724 Windows 消息队列 (优先队列)
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2724 Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something h...
分类:Windows程序   时间:2014-05-11 20:31:56    阅读次数:796
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!