map内部是用红黑树维持的有序结构。定义:mapmapStudent;查找的时间复杂度为对数级别.1.构造方法学习两种:第一种:用insert函数插入pair数据,mapStudent.insert(pair(0,"jiangjing"));第二种:用数组方式插入数据mapStudent[1] = ...
                            
                            
                                分类:
其他好文   时间:
2014-08-25 11:38:54   
                                阅读次数:
194
                             
                    
                        
                            
                            
                                network namespace与veth pair
                            
                            
                                分类:
Web程序   时间:
2014-08-22 00:07:19   
                                阅读次数:
534
                             
                    
                        
                            
                            
                                /*
 * 	map.cpp
 *
 *  Created on: 2014-8-20
 *      Author: dengxiaobing
 */
#include 
#include 
#include 
#include 
/*1. 定义一个函数指针*/
typedef void * (* pCreateFun)() ;
/*2. 定义一个pair*/
typedef std::pai...
                            
                            
                                分类:
其他好文   时间:
2014-08-20 16:23:52   
                                阅读次数:
205
                             
                    
                        
                            
                            
                                11.12 编写程序,读入string和int的序列,将每个string和int存入一个pair中,pair保存在一个vector中。#include#include#include#includeusing namespace std;int main(){ vector> vec; ...
                            
                            
                                分类:
其他好文   时间:
2014-08-18 21:43:22   
                                阅读次数:
239
                             
                    
                        
                            
                            
                                Intersecting LinesTime Limit:1000MSMemory Limit:10000KTotal Submissions:10967Accepted:4930DescriptionWe all know that a pair of distinct points on a p...
                            
                            
                                分类:
其他好文   时间:
2014-08-18 20:11:22   
                                阅读次数:
244
                             
                    
                        
                            
                            
                                题意: 判断给出的线段是否组成了多边形。Solution: 简单题,并查集+hash 这里用map实现code#include #include #include #include using namespace std;typedef pair ii;map f;int f...
                            
                            
                                分类:
其他好文   时间:
2014-08-18 17:45:12   
                                阅读次数:
277
                             
                    
                        
                            
                            
                                A pair of numbers has a unique LCM but a single number can be the
LCM of more than one possible pairs. Forexample 12 is the
LCM of (1, 12), (2, 12), 
(3,4) etc. For a given positive integer N, the ...
                            
                            
                                分类:
其他好文   时间:
2014-08-18 16:25:24   
                                阅读次数:
240
                             
                    
                        
                            
                            
                                pair是STL中的模板类型,它可以存储两个元素,它也被称作“对组”。pair没有什么强大功能函数,其源代码很简单。...
                            
                            
                                分类:
其他好文   时间:
2014-08-17 22:48:26   
                                阅读次数:
268
                             
                    
                        
                            
                            
                                ZOJ Problem Set - 1456
Minimum Transport Cost
Time Limit: 2 Seconds      
Memory Limit: 65536 KB 
These are N cities in Spring country. Between each pair of cities there may be one transportat...
                            
                            
                                分类:
其他好文   时间:
2014-08-17 15:36:22   
                                阅读次数:
193
                             
                    
                        
                            
                            
                                map是STL中的标准关系容器,它存储的元素时pair,拥有键值key和实值value。按照键值key存储到红黑树中,用红黑树提供的函数操作map。...
                            
                            
                                分类:
其他好文   时间:
2014-08-16 12:35:40   
                                阅读次数:
202