摘要: 内置类型 介绍 pair的应用 将两个数据合成一个数据(元组),方便使用。如当一个函数需要返回两个数据,可以返回pair类型。pair的实现是一个结构体。有两个成员:first,second。 make_pair函数 usage1: 灵活的方式,会自动进行类型转换,T1为int,T2为double 阅读全文
posted @ 2019-03-04 18:49 LFYZOI题解 阅读(966) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include include include using namespace std; typedef long long ll; priority_queue, greater a; //greater表示从大到小排序,形成小根堆 //less表示从小到大排序,形成 阅读全文
posted @ 2019-03-04 12:05 LFYZOI题解 阅读(133) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include using namespace std; const int maxn=1e5+5; int a[maxn], n; void adjust(int s, int t) { int dad=s; int son=dad 2; while(sona[son 阅读全文
posted @ 2019-03-04 11:54 LFYZOI题解 阅读(148) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include include using namespace std; const int MAXN=1e5+5; //100005 int a[MAXN], temp[MAXN], n; void MergeSort(int l, int r) //再次提醒函数慎用 阅读全文
posted @ 2019-03-04 11:23 LFYZOI题解 阅读(156) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include using namespace std; using namespace std; const int maxn = 1e5 + 5; //100005 int a[maxn], n; //写法1,推荐使用写法2 void QuickSort(int s 阅读全文
posted @ 2019-03-04 11:07 LFYZOI题解 阅读(272) 评论(0) 推荐(0) 编辑