![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
STL
smallacmer
这个作者很懒,什么都没留下…
展开
-
The 36th ACM/ICPC Asia Regional Dalian Site —— Online Contest &&The kth great number
http://acm.hdu.edu.cn/showproblem.php?pid=4006Problem DescriptionXiao Ming and Xiao Bao are playing a simple Numbers game. In a roun原创 2011-09-22 11:38:10 · 623 阅读 · 0 评论 -
http://acm.nyist.net/JudgeOnline/problem.php?pid=527&&AC_mm玩dota
STL入门题~~,考查的是bitset,不解释。。。。。#include#include#include#include#define N 35#define M 1314520#includeusing namespace std;int s[250];void financial(){ s[0]=0;s[1]=1; for(int i=2;i<210;++i)原创 2012-07-09 15:59:22 · 660 阅读 · 0 评论 -
http://cdn.ac.nbutoj.com/Problem/view.xhtml?id=1184&&Elaine's Queue
一道模拟题~~可以用STL的双向队列来解决~~~#include#include#include#includeusing namespace std;int main(){ int T; scanf("%d",&T); while(T--) { dequeQ; int n,m; scanf("%d%d",&n,&m); for(int i=1;i<=n;+原创 2012-07-07 15:59:22 · 817 阅读 · 0 评论 -
priorit—queue用法
priority_queue 调用 STL里面的 make_heap(), pop_heap(), push_heap() 算法实现,也算是堆的另外一种形式。先写一个用 STL 里面堆算法实现的与真正的STL里面的 priority_queue 用法相似的 priority_queue, 以加深对 priority_queue 的理解STL里面的 priority_que原创 2012-04-05 15:22:20 · 874 阅读 · 0 评论 -
map及set中自定义比较函数
首先对于map如果采用默认的比较函数,是按键值由小到大插入元素的。。set和map集合容器实现了红黑树的平衡二叉检索树的数据结构,平衡二叉检索树使用中序遍历的算法。#include#include#include#include//map是按键值排序#includeusing namespace std;struct info//结构体时直接在结构体中重载即可{ strin原创 2012-04-19 20:28:15 · 1264 阅读 · 0 评论 -
http://acm.nyist.net/JudgeOnline/problemrank.php?pid=525
可以当做STL的入门题,,杯具的是我竟然忘记考虑字符串最后一个不应定是以5结束,因此总是少一个数据。。#include#include#include#include#includeusing namespace std;int main(){ string s; while(cin>>s) { multiset q; string原创 2012-04-12 15:35:10 · 668 阅读 · 0 评论 -
http://acm.hdu.edu.cn/showproblem.php?pid=2094
题意:给你n个比赛结果问能不能产生冠军。。思路:当且仅当只有一个人没有输过一场比赛时。。#include#include#include#includeusing namespace std;int main(){ int n; while(cin>>n&&n) { map m; for(int i=0;i!=n;++i) { string a,b;原创 2012-04-05 10:43:47 · 616 阅读 · 0 评论 -
bsearch用法
C语言中 bsearch 包含在头文件中,此函数可以根据你给的条件实现二分查找,如果找到元素则返回指向该元素的指针,否则返回NULL;对于有多个元素匹配成功的情况,bsearch()未定义返回哪一个。使用 bsearch 函数也要自己定义比较子函数。函数原型:void *bsearch(const void *key, const void *base, size_t num, siz原创 2012-03-31 13:16:53 · 2516 阅读 · 0 评论 -
c++&&map函数
c++ Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力,由于这个特性,它完成有可能在我们处理一对一数据的时候,在编程上提供快速通道。这里说下map内部数据的组织,map内原创 2011-09-22 18:15:40 · 464 阅读 · 0 评论 -
TwiceString
Problem Statement You are given a string s. Return the shortest string which contains s as a contiguous substring twice.Note原创 2011-09-15 13:20:56 · 413 阅读 · 0 评论 -
Holedox Eating &&http://acm.hdu.edu.cn/showproblem.php?pid=4302
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 883 Accepted Submission(s): 307Problem DescriptionHoledox is a small animal which can be原创 2012-07-21 10:35:41 · 753 阅读 · 0 评论