码迷,mamicode.com
首页 >  
搜索关键字:stl    ( 6205个结果
Poj 1151 Invitation Cards dijkstra 堆优化
很裸的最短路,不过节点数和边数都是1e6,直接dij肯定是不行了,稀疏图用heap优化一下就好o(╯□╰)o注意STL里面的优先队列是优先级大的(值大的)在前面的,一开始没注意WA了好几发,哎,太粗心了#include #include #include #include #include #inc...
分类:其他好文   时间:2014-07-22 22:54:33    阅读次数:212
参考C++STL标准库中对了的使用方法
http://www.cppblog.com/zhenglinbo/archive/2012/09/18/191170.html参考:http://www.cppblog.com/zhenglinbo/archive/2012/09/18/191170.html当然是使用c++中的STL 的queu...
分类:编程语言   时间:2014-07-19 19:34:33    阅读次数:220
0716-----C++Primer听课笔记----------STL之顺序容器、迭代器
1. 顺序容器的初始化操作1.1 顺序容器(vector,list,deque)的五种初始化方法,以 vector 为例。#include #include #include using namespace std;int main(int argc, const char *argv[]){ .....
分类:编程语言   时间:2014-07-19 19:27:08    阅读次数:278
STL 源码剖析 stl_numeric.h -- copy
唯一对外接口 /*-------------------------------------------------------------------------------------- * copy 函数及其重载形式 */ //完全泛化版本。 template // ? 这里的 InputIterator 和 OutputIterator 都只是名称而已,哪里确保了它们真的至少是 InputIterator 和 O...
分类:其他好文   时间:2014-07-18 22:39:22    阅读次数:302
STL 源码剖析 stl_numeric.h
描述、源码、示例 version 1:普通操作版本 version 2: 泛化操作版本 1.accumulate 描述:计算 init 和 [first, last) 内所有元素的总和 源码: //version 1 template T accumulate(InputIterator first, InputIterator last, T init) { for ( ; first != last; ++first) ini...
分类:其他好文   时间:2014-07-18 22:16:32    阅读次数:283
STL 源码剖析 stl_algobase.h
1.iter_swap 描述:将两个 ForwardIterator 所指的对象对调 源码: //version 1 template inline void __iter_swap(ForwardIterator1 a, ForwardIterator2 b, T*) { T tmp = *a; *a = *b; *b = tmp; } //version 2 template...
分类:其他好文   时间:2014-07-18 21:32:42    阅读次数:244
【转】hash_map介绍与使用
转自:http://blog.csdn.net/holybin/article/details/26050897 0 概述 虽然hash_map和map都是STL的一部分,但是目前的C++标准(C++11)中只有map而没有hash_map,可以说STL只是部分包含于目前的C++标准中。主流的GNU...
分类:其他好文   时间:2014-07-18 19:20:07    阅读次数:316
【程序员编程艺术】学习记录2:左旋转字符串之循环移位法
【程序员编程艺术】学习记录2:左旋转字符串之循环移位法 GCD算法:(辗转相除法/欧几里得算法) gcd是求最大公约数的算法,作为TAOCP第一个算法 gcd算法流程: 首先给定两个整数m,n(m大于等于n)如果小于则直接交换再处理 ①求余数 r=m%n ②假如r=0,算法结束,n即为所求 否则,重新令m STL中rotate算法: 对于数组移位问题,可以采用下面方法:...
分类:其他好文   时间:2014-07-18 16:38:35    阅读次数:243
BZOJ 2761 不重复数字 (Hash)
题解:直接使用STL中的hash去重即可#include #include using namespace std;int ans[50010];int main(){ int T,n,tmp; scanf("%d",&T); while(T--){ int cnt=...
分类:其他好文   时间:2014-07-17 10:02:58    阅读次数:231
stl_algo.h
// Algorithm implementation -*- C++ -*-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,// 2010, 2011// Free Software Foundation,...
分类:其他好文   时间:2014-07-16 16:56:01    阅读次数:375
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!