![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++ STL
eeetttzhangji
这个作者很懒,什么都没留下…
展开
-
#include<stack> 南阳oj括号匹配
描述 现在,有一行括号序列,请你检查这行括号是否配对。 输入第一行输入一个数N(0 输出每组输入数据的输出占一行,如果该字符串中所含的括号是配对的,则输出Yes,如果不配对则输出No 样例输入 3 [(]) (]) ([[]()]) 样例输出 No No Yes c++ stl栈stack介绍 C++ Stack(堆栈) 是一个原创 2017-03-18 21:34:17 · 1479 阅读 · 0 评论 -
c++ string的运用
You are given a string s and should process m queries. Each query is described by two 1-based indices li, ri and integer ki. It means that you should cyclically shift the substring s[li... ri] ki ti原创 2017-04-03 20:31:56 · 290 阅读 · 0 评论 -
set的简单应用
MG loves gold Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 144 Accepted Submission(s): 85 Problem Description MG is a lucky boy原创 2017-04-02 20:19:30 · 441 阅读 · 0 评论 -
C++中lower_bound函数和upper_bound函数
STL中关于二分查找的函数有三个lower_bound 、upper_bound 、binary_search 。这三个函数都运用于有序区间(当然这也是运用二分查找的前提),下面记录一下这两个函数。 ForwardIter lower_bound(ForwardIter first, ForwardIter last,const _Tp& val)算法返回一个非递减序列[first,转载 2017-03-25 21:20:06 · 573 阅读 · 0 评论 -
C. Andryusha and Colored Balloons
C. Andryusha and Colored Balloons time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Andryusha goes through a转载 2017-03-16 12:41:03 · 372 阅读 · 0 评论 -
STL 双向队列
deque双端队列容器与vector很类似,采用线性表顺序存储结构。但与vector区别,deque采用分块的线性存储结构来存储数据,每块的大小一般为512B,将之称为deque块,所有的deque块使用一个map块进行管理,每个map数据项记录各个deque块的首地址,这样的话,deque块在头部和尾部都可以插入和删除。而不需要移动任何元素,而不需要移动其他元素(使用push_back()方法在转载 2017-04-01 11:37:49 · 361 阅读 · 1 评论 -
B. Not Afraid STL set
B. Not Afraid time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Since the giant heads have appeared in the sk原创 2017-03-24 11:51:09 · 919 阅读 · 0 评论 -
c++ set
#include #include #include using namespace std; set S; int main() { int temp; int i; for(i=1;i<7;i++) { cin>>temp; S.insert(temp); } cout<<S.size()<<endl; set::iterator r; set::reverse_ite原创 2017-03-14 17:24:00 · 318 阅读 · 0 评论 -
c++ string
#include #include using namespace std; int main() { string strinfo="Please input your name:"; cout << strinfo ; cin >> strinfo; if( strinfo == "winter" ) cout << "you are winter!"<<endl; else转载 2017-03-14 16:51:08 · 156 阅读 · 0 评论 -
map 的使用例子
Skip the Class Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 374 Accepted Submission(s): 222 Problem Description Finally term原创 2017-03-14 16:11:52 · 330 阅读 · 0 评论 -
long double atan2函数 Pi=acos(-1)
You are given the set of vectors on the plane, each of them starting at the origin. Your task is to find a pair of vectors with the minimal non-oriented angle between them. Non-oriented angle is non-原创 2017-04-03 21:20:56 · 872 阅读 · 0 评论