#include<bits/stdc++.h>
using namespace std;
struct Edge{
int a, b, c;
// Edge(int m = 0, int p = 0, int q = 0) {
// a = 1, b = 1, c = 3;
// }
bool operator <(const Edge& e) const{
return c < e.c; //从小到大
}
}q[10];
bool cmp1(const Edge& e1, const Edge& e2){
return e1.c < e2.c; // 从小到大
}
bool cmp2(const pair<int, int>& p1, const pair<int, int>& p2){
return p1.second < p2.second;
}
int main()
{
//memset, memcpy(cpy, d, sizeof d)
// 长度为10,且每个数为3
// a.size(), a.empty(), a.clear()
// push_back(), pop_back()
// begin(), end()
vector<int> a = {1, 3, 4, 5, 2};
sort(a.begin(), a.end()); // 从小到大
sort(a.begin(), a.end(), greater<int>()); //从大到小
reverse(a.begin(), a.end());
// a.erase(unique(a.bgin(), a.end()), a.end())
// it = lower_bound(a.begin(), a.end())
for(auto t : a) cout << t <<" ";
cout << endl;
q[0] = {5, 5, 1}, q[1] = {4, 4, 2};
sort(q, q + 2, cmp1);
cout << q[0].c << endl;
// p = make_pair(10, "abc");
pair<int, int> pr[5] = {{1, 5}, {2, 4}};
stable_sort(pr, pr + 2, cmp2);
cout << pr[0].first << " " << pr[0].second << endl;
// str.substr(i, length)
// str.c_str()
// str.find(), str.find(str, pos)
// str.find_first_of() str.find_last_of
string str = "abcabc";
priority_queue<int> heap; // 最大堆
priority_queue<int, vector<int>, greater<int> > minheap; //最小堆
map<int, string> mp;
mp[1] = "abc"; mp[0] = "bcd"; mp[2] = "plk";
// cout << mp.count(0);
for(map<int, string>::iterator it = mp.find(1); it != mp.end(); it ++)
cout << (*it).first << " " << (*it).second << endl;
cout << 10 * sizeof q[0] << endl;
}