STL
QQQQQHY
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.
—Tanenbaum, Andrew S. (1989).
展开
-
1063 合并果子 优先队列
优先队列原创 2016-09-13 10:42:28 · 218 阅读 · 0 评论 -
STL-Map
Map原创 2016-08-24 16:22:18 · 210 阅读 · 0 评论 -
树状数组
includeincludeusing namespace std;int c[100010],n,m;int query(int k){ int ans=0; for(int i=k;i>0;i-=i&(-i)) ans+=c[i]; return ans; } void up(int k,int v){ for(int i=k;i<=n原创 2016-09-24 17:11:03 · 148 阅读 · 0 评论 -
set 的使用
set可以插入很多值,去掉重复元素,并可以查找#include<iostream> #include<cstdio> #include<string> #include<set> using namespace std; int main(){ set<string> st; st.clear(); //清空 string nm[]={"abc","david","lucy"原创 2016-09-21 16:53:14 · 198 阅读 · 0 评论 -
STL——Vector Test
一個很典型使用vector的STL程式:原创 2016-10-17 09:34:59 · 495 阅读 · 0 评论 -
STL—stable_partition
#include<algorithm> #include<iostream>using namespace std;int f(char c){ return c>'c'; } int main(){ string s="abcdeedcba"; char c=*(stable_partition(s.begin(),s.end(),f)-1); cout<<s<<原创 2016-10-28 16:24:29 · 257 阅读 · 0 评论 -
STL—transform
#include<algorithm> #include<iostream> #include<cctype>//toupper using namespace std; //transform(数据起始,结束,写入目标的起始,执行的操作)//遍历一个容器里面元素 然后执行一个操作 int f(char c){ return c+1; } int main(){ string s原创 2016-10-28 16:43:42 · 223 阅读 · 0 评论 -
STL标准库中的算法函数
STL标准库中的算法函数转载 2016-10-29 16:36:23 · 211 阅读 · 0 评论