![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序
@阿奇@
做一个勤勉、有趣、善良的人
展开
-
poj2299&&归并排序
#include <iostream> #include <stdio.h> //error: reference to 'left' is ambiguous|把left换成left_就好了 using namespace std; const int maxn=500010; const int INF=0x7fffffff; int s[maxn],left_[maxn],right_[max原创 2017-12-11 21:07:09 · 271 阅读 · 0 评论 -
数据结构总结之sort(排序)
1.反转int数组:void g(int t)//反转从第一个到第t个数 { for(int i=0; i<(n-t+1)/2; i++) swap(a[i],a[n-i-t]); }2.输入的int数组不知道元素个数,用vector+getchar()#include <bits/stdc++.h> using namespace std; vector<int> v; i原创 2017-12-16 10:51:04 · 525 阅读 · 0 评论