stl积累
acblacktea
永不放弃
展开
-
poj-1833-排列 stl next_permutation(a,a+n)
#include<cstdio> #include<algorithm> using namespace std; int t,n,m; int a[2000]; int main() { scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); for(int i=0;i<n;i++)原创 2016-04-01 23:08:01 · 378 阅读 · 0 评论 -
acm_stl
//转自各个博客 1.队列先进先去#include<queue> using namespace std; queue<int>qu; //进取删 qu.push(); qu.front(); qu.pop();2.栈后进先出#include<stack> using namespace std; stack<int>st; //进取删 st.push(); st.top(); st.pop();原创 2016-05-21 19:56:57 · 3642 阅读 · 0 评论 -
codeforces633D Fibonacci-ish map容器
map就是建一个红黑书 把每个元素的值都加进树种,当查找这个元素的值时算法复杂度logn 关于map的用法: map#include<cstdio> #include<cstring> #include<map> #include<algorithm> using namespace std; map<int,int>mp; map<int,int>mp2; int n; int main()原创 2016-03-01 13:11:51 · 302 阅读 · 0 评论 -
codeforces 353 div2 Tree Construction
将搜索二叉树逆时针旋转45度会发现这是n条值递增的链且头元素相连 如示例/* 8 4 2 3 1 6 10 9 8 第一条链 4 - 6———————————————————————————10 | | |原创 2016-05-19 22:51:27 · 408 阅读 · 0 评论 -
poj 初级训练计划数据结构总结
两个下午一个晚上搞完了还是学到很多东西的。poj 1035,3080,1936简单C语言题。3080可以KMP,但数据水可以枚举,KMP的话就是把第一个串的所有子串与下面几个串匹配难度也不大。 poj 2388 就是sort. poj 2299 求逆序数==归并排序 当两个区间都排好时合并时你就可以跳跃性的直接求一个数和别的数有几个逆序而不是一个一个都比过来。这题可以当归并排序模板。 总体来说原创 2016-04-30 00:04:56 · 980 阅读 · 0 评论