STL 源码分析 # stl_pair #
pair是一种很简单也很常用的关联容器(associative container).
/***********************************************
Programmer : EOF
Date : 2015.04.10
File : pair.cpp
E-mail : jaso...
分类:
其他好文 时间:
2015-04-10 15:32:52
阅读次数:
160
PairTime Limit: 1000msMemory Limit: 65536KB64-bit integer IO format:%lld Java class name:MainPrevSubmitStatusStatisticsDiscussNextType:NoneTag it!给出一个...
分类:
其他好文 时间:
2015-04-09 16:50:03
阅读次数:
160
背景:第一因为找到结果之后没有及时的停止查找而wa了一发,改正后ac。
思路:首先对读入的每一个string,设置一个独特的ID,这样就把string变为int,后来比较的时候就会简化很多,设置ID的时候用map来赋予每一种string对应一个独特的ID。然后构建一个key为pair的map,因为行比较多列比较少(列的数为10),就枚举列的所有组合,然后对每组组合来进行map判重。
我的代码;...
分类:
其他好文 时间:
2015-04-05 10:37:36
阅读次数:
108
关联容器1、关联容器与顺序容器的本质区别在于,关联容器是按键key存储和读取元素且按key有序存放,而顺序容器则是按容器中的位置来访问元素,顺序至于加入容器的先后相关。
2、map存储key-value的pairpair p(v1,v2);//构造给定值的pair
make_pair(v1,v2);//以函数make_piar构造pair6、map是key_value的集...
分类:
编程语言 时间:
2015-04-05 09:08:57
阅读次数:
203
#include
#include
#include
#include
#include
#include
using namespace std;
typedef long long LL;
typedef pair P;
#define maxn 10000+10
int rank[maxn<<1];
int p[maxn<<1];
int n, m, R;
struct ed...
分类:
其他好文 时间:
2015-04-01 22:03:00
阅读次数:
111
#include
using namespace std;
#define INF 0x7ffffff
typedef pair P;
#define maxn 100000+10
struct edge
{
int to;
int cost;
edge(){}
edge(int to_, int cost_)
{
to = to_;
...
分类:
其他好文 时间:
2015-03-29 12:18:27
阅读次数:
130
练习3-68原文Exercise 3.68. Louis Reasoner thinks that building a stream of pairs from three parts is unnecessarily complicated. Instead of separating the pair (S0,T0) from the rest of the pairs in the fir...
分类:
其他好文 时间:
2015-03-29 10:52:16
阅读次数:
136
#include
using namespace std;
#define maxn 100000+10
#define INF 0x7ffffff
typedef pair P;
struct edge
{
int to;
int cost;
edge(){}
edge(int to_, int cost_)
{
to = to_;
...
分类:
编程语言 时间:
2015-03-29 10:51:49
阅读次数:
188
专用名词解释:
FleetAssignment 是对航段选机型;
Aircraftroutig是安排routing的;
Crew paring是航班组环,不针对某个具体aircraft;针对给定的飞行员的资质和机型,以最小化成本(尽量使所有的成本都在飞行时间上)为目标,给出仅覆盖所有flight leg一次的pair (从base出发最后回到base)集合,
l 以员工的种类为依据进行分...
分类:
其他好文 时间:
2015-03-20 16:31:54
阅读次数:
144
#include
#include
#include
using namespace std;
int main()
{
map m; //m容器的定义
m.insert(make_pair(1,"one")); //m容器的赋值第一个数是整数,第二数是字符串
m.insert(make_pair(10,"ten"));
...
分类:
其他好文 时间:
2015-03-18 14:11:40
阅读次数:
118