NYOJ STL练习 习题汇总

来源:互联网 发布:steam中mac游戏 编辑:程序博客网 时间:2024/06/08 13:24

括号配对问题

时间限制:3000 ms  |  内存限制:65535 KB
难度:3
描述
现在,有一行括号序列,请你检查这行括号是否配对。
输入
第一行输入一个数N(0<N<=100),表示有N组测试数据。后面的N行输入多组输入数据,每组输入数据都是一个字符串S(S的长度小于10000,且S不是空串),测试数据组数少于5组。数据保证S中只含有"[","]","(",")"四种字符
输出
每组输入数据的输出占一行,如果该字符串中所含的括号是配对的,则输出Yes,如果不配对则输出No
样例输入
3[(])(])([[]()])
样例输出
NoNo

Yes

//讲输入的括号存在字符数组里面,定义一个栈s,遍历数组,如果数组元素与栈顶元素可匹配,出栈,否则入栈 #include<cstdio>#include<cstring>#include<stack>using namespace std;const int maxn = 10000 + 5;char a[maxn];int main(){int T;scanf("%d",&T);while(T--){scanf("%s",a);int len = strlen(a);stack<char>s;for(int i = 0; i < len; i++){if(a[i] == ']'&&s.size()&&s.top()=='['){s.pop(); }else if(a[i] == ')'&&s.size()&&s.top()=='('){s.pop();}else{s.push(a[i]);}}if(s.size()){printf("No\n"); }else{printf("Yes\n");}}return 0;}        

1. stack 
stack 模板类的定义在头文件中。 
stack 模板类需要两个模板参数,一个是元素类型,一个容器类型,但只有元素类型是必要 
的,在不指定容器类型时,默认的容器类型为deque。 
定义stack 对象的示例代码如下: 
stack<int> s1; 
stack<string> s2;

stack 的基本操作有: 
入栈,如例:s.push(x); 
出栈,如例:s.pop();注意,出栈操作只是删除栈顶元素,并不返回该元素。 
访问栈顶,如例:s.top() 
判断栈空,如例:s.empty(),当栈空时,返回true。 
访问栈中的元素个数,如例:s.size().

2. queue 
queue 模板类的定义在<queue>头文件中。 
与stack 模板类很相似,queue 模板类也需要两个模板参数,一个是元素类型,一个容器类 
型,元素类型是必要的,容器类型是可选的,默认为deque 类型。 
定义queue 对象的示例代码如下: 
queue<int> q1; 
queue<double> q2;

queue 的基本操作有: 
入队,如例:q.push(x); 将x 接到队列的末端。 
出队,如例:q.pop(); 弹出队列的第一个元素,注意,并不会返回被弹出元素的值。 
访问队首元素,如例:q.front(),即最早被压入队列的元素。 
访问队尾元素,如例:q.back(),即最后被压入队列的元素。 
判断队列空,如例:q.empty(),当队列空时,返回true。 
访问队列中的元素个数,如例:q.size()

ASCII码排序

时间限制:3000 ms  |  内存限制:65535 KB
难度:2
描述
输入三个字符(可以重复)后,按各字符的ASCII码从小到大的顺序输出这三个字符。
输入
第一行输入一个数N,表示有N组测试数据。后面的N行输入多组数据,每组输入数据都是占一行,有三个字符组成,之间无空格。
输出
对于每组输入数据,输出一行,字符中间用一个空格分开。
样例输入
2qweasd
样例输出
e q wa d s
利用sort排序

#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;int main(){int N;scanf("%d",&N);while(N--){char a[100];scanf("%s",a);int length = strlen(a);sort(a,a+length);for(int i = 0; i < length; i++){printf("%c ",a[i]);}printf("\n");} } 

Binary String Matching

时间限制:3000 ms  |  内存限制:65535 KB
难度:3
描述
Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as a substring of B? For example, the text string B is ‘1001110110’ while the pattern string A is ‘11’, you should output 3, because the pattern A appeared at the posit
输入
The first line consist only one integer N, indicates N cases follows. In each case, there are two lines, the first line gives the string A, length (A) <= 10, and the second line gives the string B, length (B) <= 1000. And it is guaranteed that B is always longer than A.
输出
For each case, output a single line consist a single integer, tells how many times do B appears as a substring of A.
样例输入
31110011101101011100100100100011010110100010101011 
样例输出
303 
#include<iostream>#include<string>#include<stdio.h>using namespace std;int main(){int N;scanf("%d",&N);while(N--){string a, b;cin>>a>>b;int count = 0; int position = b.find(a,0);//find 函数 返回jk 在s 中的下标位置 while(position!=string::npos){count++;position = b.find(a,position+1);}printf("%d\n",count);}return 0;}http://www.cnblogs.com/web100/archive/2012/12/02/cpp-string-find-npos.html

一种排序

时间限制:3000 ms  |  内存限制:65535 KB
难度:3
描述
现在有很多长方形,每一个长方形都有一个编号,这个编号可以重复;还知道这个长方形的宽和长,编号、长、宽都是整数;现在要求按照一下方式排序(默认排序规则都是从小到大);

1.按照编号从小到大排序

2.对于编号相等的长方形,按照长方形的长排序;

3.如果编号和长都相同,按照长方形的宽排序;

4.如果编号、长、宽都相同,就只保留一个长方形用于排序,删除多余的长方形;最后排好序按照指定格式显示所有的长方形;
输入
第一行有一个整数 0<n<10000,表示接下来有n组测试数据;
每一组第一行有一个整数 0<m<1000,表示有m个长方形;
接下来的m行,每一行有三个数 ,第一个数表示长方形的编号,

第二个和第三个数值大的表示长,数值小的表示宽,相等
说明这是一个正方形(数据约定长宽与编号都小于10000);
输出
顺序输出每组数据的所有符合条件的长方形的 编号 长 宽
样例输入
181 1 11 1 11 1 21 2 11 2 22 1 12 1 22 2 1
样例输出
1 1 11 2 11 2 22 1 12 2 1

#include<stdio.h>#include<algorithm>using namespace std;struct rectangle{int number;int length;int wide;}rec[1005];int cmp(rectangle a,rectangle b){if(a.number!=b.number){return a.number < b.number;}else if(a.length!=b.length){return a.length < b.length;}else if(a.wide!=b.wide){return a.wide<b.wide; }}bool isEquals(rectangle x,rectangle y){if(x.number==y.number&&x.length==y.length&&x.wide==y.wide){return true;}else{return false;}}int main(){int n;scanf("%d",&n);while(n--){int m;scanf("%d",&m);for(int i = 0; i < m; i++){scanf("%d%d%d",&rec[i].number,&rec[i].length,&rec[i].wide);int t;if(rec[i].length<rec[i].wide){t = rec[i].length;rec[i].length=rec[i].wide;rec[i].wide = t;}}sort(rec,rec+m,cmp);for(int i = 0; i < m; i++){if(!isEquals(rec[i],rec[i+1])){printf("%d %d %d\n",rec[i].number,rec[i].length,rec[i].wide);}}}return 0;}//判断结构体是否相等 

擅长排列的小明

时间限制:1000 ms  |  内存限制:65535 KB
难度:4
描述
小明十分聪明,而且十分擅长排列计算。比如给小明一个数字5,他能立刻给出1-5按字典序的全排列,如果你想为难他,在这5个数字中选出几个数字让他继续全排列,那么你就错了,他同样的很擅长。现在需要你写一个程序来验证擅长排列的小明到底对不对。
输入
第一行输入整数N(1<N<10)表示多少组测试数据,
每组测试数据第一行两个整数 n m (1<n<9,0<m<=n)
输出
在1-n中选取m个字符进行全排列,按字典序全部输出,每种排列占一行,每组数据间不需分界。如样例
样例输入
23 14 2
样例输出
123121314212324313234414243
#include<cstdio>#include<cstring>#include<algorithm>#include<cstdlib>using namespace std;int a[10]={1,2,3,4,5,6,7,8,9}, b[10];int main(){int N;scanf("%d", &N);while(N--){int n, m,i;scanf("%d %d", &n, &m);memcpy(b, a, sizeof(int) * m);for(int i = 0; i < m; i++)printf("%d", a[i]);printf("\n");while (next_permutation(a, a + n)){if(memcmp(b, a, sizeof(int) *m) != 0){for(i = 0; i < m; i++)printf("%d", a[i]);printf("\n");memcpy(b, a, sizeof(int) * m);}}}return 0;}//next_permutation

懒省事的小明

时间限制:3000 ms  |  内存限制:65535 KB
难度:3
描述
      小明很想吃果子,正好果园果子熟了。在果园里,小明已经将所有的果子打了下来,而且按果子的不同种类分成了不同的堆。小明决定把所有的果子合成一堆。 因为小明比较懒,为了省力气,小明开始想点子了:
  每一次合并,小明可以把两堆果子合并到一起,消耗的体力等于两堆果子的重量之和。可以看出,所有的果子经过n-1次合并之后,就只剩下一堆了。小明在合并果子时总共消耗的体力等于每次合并所耗体力之和。 
  因为还要花大力气把这些果子搬回家,所以小明在合并果子时要尽可能地节省体力。假定每个果子重量都为1,并且已知果子的种类数和每种果子的数目,你的任务是设计出合并的次序方案,使小明耗费的体力最少,并输出这个最小的体力耗费值。 
  例如有3种果子,数目依次为1,2,9。可以先将1、2堆合并,新堆数目为3,耗费体力为3。接着,将新堆与原先的第三堆合并,又得到新的堆,数目为12,耗费体力为12。所以小明总共耗费体力=3+12=15。可以证明15为最小的体力耗费值。
输入
第一行输入整数N(0<N<=10)表示测试数据组数。接下来每组测试数据输入包括两行,第一行是一个整数n(1<=n<=12000),表示果子的种类数。第二行包含n个整数,用空格分隔,第i个整数ai(1<=ai<=20000)是第i种果子的数目。
输出
每组测试数据输出包括一行,这一行只包含一个整数,也就是最小的体力耗费值。
样例输入
13 1 2 9
样例输出
15

//优先队列 #include<iostream>#include<stdio.h>#include<queue> using namespace std; int main() {     int i,m,n,a;     long long s,sum,b[12000];     priority_queue<int,vector<int>,greater<int> >pri_q;//改变优先级     cin>>n;     while(n--)     {        while(!pri_q.empty())         pri_q.pop();         cin>>m;         sum=0;         for(i=0;i<m;i++)         {           cin>>a;           pri_q.push(a);         }         if(m==1) {cout<<a<<endl;continue;}         for(i=0;i<m-1;i++)         {              s=pri_q.top();  pri_q.pop();              s+=pri_q.top(); b[i]=s; pri_q.pop();              pri_q.push(s);         }         for(i=0;i<m-1;i++) sum+=b[i];         cout<<sum<<endl;     }return 0; }

//set #include<set>#include<cstdio>using namespace std;int main(){int n;scanf("%d",&n);while(n--){int sum=0;multiset<int> v;int m;scanf("%d",&m);while(m--){int temp;scanf("%d",&temp);v.insert(temp);}while(1){if(v.size()==1){ break;}multiset<int>::iterator i=v.begin();int a=*i;int b=*(++i);v.erase(v.begin());v.erase(v.begin());v.insert(a+b);sum+=a+b;}printf("%d\n",sum);}}      

找球号(一)

时间限制:3000 ms  |  内存限制:65535 KB
难度:3
描述
在某一国度里流行着一种游戏。游戏规则为:在一堆球中,每个球上都有一个整数编号i(0<=i<=100000000),编号可重复,现在说一个随机整数k(0<=k<=100000100),判断编号为k的球是否在这堆球中(存在为"YES",否则为"NO"),先答出者为胜。现在有一个人想玩玩这个游戏,但他又很懒。他希望你能帮助他取得胜利。
输入
第一行有两个整数m,n(0<=n<=100000,0<=m<=1000000);m表示这堆球里有m个球,n表示这个游戏进行n次。
接下来输入m+n个整数,前m个分别表示这m个球的编号i,后n个分别表示每次游戏中的随机整数k
输出
输出"YES"或"NO"
样例输入
6 423 34 46 768 343 3432 4 23 343
样例输出
NONOYESYES
 #include<map>  #include<stdio.h>  using namespace std;  map<int ,int > ball;//全局变量自动赋初值为0  int main()  {      int m,n,a;      scanf("%d%d",&m,&n);      while(m--)      {          scanf("%d",&a);          ball[a]=1;      }      while(n--)      {          scanf("%d",&a);          if(ball.count(a))              puts("YES");          else              puts("NO");      }  }         

汉诺塔(三)

时间限制:3000 ms  |  内存限制:65535 KB
难度:3
描述

在印度,有这么一个古老的传说:在世界中心贝拿勒斯(在印度北部)的圣庙里,一块黄铜板上插着三根宝石针。印度教的主神梵天在创造世界的时候,在其中一根针上从下到上地穿好了由大到小的64片金片,这就是所谓的汉诺塔。不论白天黑夜,总有一个僧侣在按照下面的法则移动这些金片:一次只移动一片,不管在哪根针上,小片必须在大片上面。僧侣们预言,当所有的金片都从梵天穿好的那根针上移到另外一根针上时,世界就将在一声霹雳中消灭,而梵塔、庙宇和众生也都将同归于尽。


现在我们把三根针编号为1,2,3。

所有的金片在初始时都在1号针上,现在给你的任务是判断一系列的指令过程中,是否会出现非法的指令。

而非法指令有以下两种情况:

1、某个针上已经没有金片了,但是指令依然要求从该处移动金片到其它针上。

2、把一个大的金片移动到了小的金片上。

输入
第一行输入一个整数N表示测试数据的组数(N<10)
每组测试数据的第一行有两个整数P,Q(1<P<64,1<Q<100),分别表示汉诺塔的层数与随后指令的条数
随后的Q行,每行都输入两个整数a,b,(1<=a,b<=3)表示一条指令。
指令1 2表示把1号针最上面的金片移动到2号针最上面。
数据保证a,b不会相同。
输出
如果存在非法指令,请输出illegal
不存在非法指令则输出legal
样例输入
32 11 23 31 21 33 22 12 1
样例输出
legalillegalillegal
#include<cstdio>#include<stack>using namespace std;int main(){int n, p, q, a, b, flag, i;scanf("%d",&n);while(n--){stack<int> sta[3];  //初始化 scanf("%d%d",&p,&q);for(i = p-1; i >=0; i--){sta[0].push(i);}//一号针从大到小进栈p个金片,大小就是标号 flag = 1;  //错误为0,正确为1. for(i = 0; i < q; i++){scanf("%d%d",&a,&b);a = a -1; b = b - 1;  //因为针的编号从0开始,所以减1 if(sta[a].empty()){  //某个针上已经没有金片了,但是指令依然要求从该处移动金片到其他针上。 flag = 0;break;}if(sta[b].empty()){  //若b为空,不用比较可以直接进栈 sta[b].push(sta[a].top());sta[a].pop();}else{   //若b不为空,要比较上下两金片大小 if(sta[b].top() < sta[a].top()){  //把一个大的金片移动到小的金片上 flag = 0;break;}else{   //正确情况,a栈顶进b栈 sta[b].push(sta[a].top());sta[a].pop();}}}if(flag)  printf("legal\n");else printf("illegal\n");}return 0;}        

众数问题

时间限制:3000 ms  |  内存限制:65535 KB
难度:3
描述

所谓众数,就是对于给定的含有N个元素的多重集合,每个元素在S中出现次数最多的成为该元素的重数,

多重集合S重的重数最大的元素成为众数。例如:S={1,2,2,2,3,5},则多重集S的众数是2,其重数为3。

现在你的任务是:对于给定的由m个自然数组成的多重集S,计算出S的众数及其重数。

输入
第一行为n,表示测试数据组数。(n<30)
每组测试的第一行是一个整数m,表示多重集S中元素的个数为m
接下来的一行中给出m(m<100)个不大于10万的自然数
(不会出现不同元素出现的次数相同的情况,如:S={11,11,22,22,33,33})。
输出
每组测试数据输出一行,包含两个数,第一个是众数,第二个是其重数,中间以空格隔开。
样例输入
161 2 2 2 3 5
样例输出
2 3

 #include <stdio.h>  #include <map>  #include <algorithm>  using namespace std;  int main()  {      map<int, int>a;       int n, m, i, max, key, x;      scanf("%d", &n);      while(n--)      {          max = key = 0;          a.clear();          scanf("%d", &m);          for(i = 0 ; i < m ; i++)          {              scanf("%d", &x);              a[x]++;              if(a[x] > key)              {                  key = a[x];                  max = x;              }          }          printf("%d %d\n", max, key);      }      return 0;  }         

n-1位数

时间限制:3000 ms  |  内存限制:65535 KB
难度:1
描述

已知w是一个大于10但不大于1000000的无符号整数,若w是n(n≥2)位的整数,则求出w的后n-1位的数。

输入
第一行为M,表示测试数据组数。
接下来M行,每行包含一个测试数据。
输出
输出M行,每行为对应行的n-1位数(忽略前缀0)。如果除了最高位外,其余位都为0,则输出0。
样例输入
4102359239231000
样例输出
23923230

#include<cstdio>  #include<cstring>  #include<algorithm>  using namespace std;  int main()  {      int n;      scanf("%d",&n);      while(n--)      {          char a[10];          scanf("%s",a);          int l=strlen(a);          int k=1;          for(;a[k]=='0';k++);  //值得借鉴         for(int i=k;i<l-1;i++)             printf("%d",a[i]-'0');          printf("%d\n",a[l-1]-'0');      }      return 0;  }  #include<stdio.h>int main(){int num, M;scanf("%d",&num);while(num--){scanf("%d",&M);int i = 10;while(M/i >= 10){i = i * 10;}printf("%d\n",M%i);}}     

字符串替换

时间限制:3000 ms  |  内存限制:65535 KB
难度:2
描述
编写一个程序实现将字符串中的所有"you"替换成"we"
输入
输入包含多行数据 

每行数据是一个字符串,长度不超过1000 
数据以EOF结束
输出
对于输入的每一行,输出替换后的字符串
样例输入
you are what you do
样例输出
we are what we do

 #include "iostream"#include "cstring"#include "cstdio"using namespace std;int main(int argc, char const *argv[]){    char a[1001];    while(gets(a)!=NULL)    {        int i,len=0;        len=strlen(a);        for(i=0; i<len; i++)        {            if(a[i]=='y'&&a[i+1]=='o'&&a[i+2]=='u')            {                cout<<"we";                i+=2;            }            else cout<<a[i];        }        cout<<endl;    }    return 0;}   #include<algorithm>//最优程序#include<iostream>#include<string>using namespace std;int main(){    string s, s1, s2;    while(getline(cin,s))    {        int flag;        s1 = "you";        s2 = "we";        flag = s.find(s1,0);        while(flag != string::npos)        {            s.replace(flag, 3, s2);            flag = s.find(s1, flag + 1);        }        cout << s << endl;    }    return 0;}            

D的小L

时间限制:4000 ms  |  内存限制:65535 KB
难度:2
描述
      一天TC的匡匡找ACM的小L玩三国杀,但是这会小L忙着哩,不想和匡匡玩但又怕匡匡生气,这时小L给匡匡出了个题目想难倒匡匡(小L很D吧),有一个数n(0<n<10),写出1到n的全排列,这时匡匡有点囧了,,,聪明的你能帮匡匡解围吗?
输入
第一行输入一个数N(0<N<10),表示有N组测试数据。后面的N行输入多组输入数据,每组输入数据都是一个整数x(0<x<10)
输出
按特定顺序输出所有组合。
特定顺序:每一个组合中的值从小到大排列,组合之间按字典序排列。
样例输入
223
样例输出
1221123132213231312321

 #include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>using namespace std;int main(){int m, n, i;scanf("%d",&n);while(n--){int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};scanf("%d",&m);do{for(i = 0; i < m; i++){printf("%d",a[i]);}printf("\n");}while(next_permutation(a,a+m));}return 0;}         

Same binary weight

时间限制:300 ms  |  内存限制:65535 KB
难度:3
描述

The binary weight of a positive  integer is the number of 1's in its binary representation.for example,the decmial number 1 has a binary weight of 1,and the decimal number 1717 (which is 11010110101 in binary) has a binary weight of 7.Give a positive integer N,return the smallest integer greater than N that has the same binary weight as N.N will be between 1 and 1000000000,inclusive,the result is guaranteed to fit in a signed 32-bit interget.

输入
The input has multicases and each case contains a integer N.
输出
For each case,output the smallest integer greater than N that has the same binary weight as N.
样例输入
17174712555555
样例输出
171881117555557
 #include <bitset>  #include <iostream>  using namespace std;    int main(){      int n, i, count, j;       while(cin >> n){          bitset<32> bt(n);          for(i = count = 0; i < 32; ++i){              if(bt[i]) ++count;              if(bt[i] && !bt[i+1]){                  bt[i] = false;                  bt[i+1] = true;                  j = i;                  break;              }          }          --count;          for(i = 0; i < count; ++i) bt[i] = true;          while(i < j) bt[i++] = false;          cout << bt.to_ulong() << endl;      }      return 0;  }   #include <cstdio>//#include <iostream>//using namespace std;//void show(unsigned n){//for(int i=31;i>=0;i--)//if(n&(1<<i))//cout<<1;//else//cout<<0;//cout<<endl;//}int main(){int i,j;unsigned n;while(scanf("%u",&n)!=-1){for(i=0;i<32;i++)if(n&(1<<i)) break;for(j=i+1;j<32;j++)if((n&(1<<j))==0) break;//show(n);n|=(1<<j);//first 0 to 1//show(n);n&=~((1<<j)-1);//1 to 0(clear)//show(n);n|=((1<<(j-i-1))-1);//0 to 1//show(n);printf("%u\n",n);}}                

Registration system

时间限制:1000 ms  |  内存限制:65535 KB
难度:2
描述

A new e-mail service "Berlandesk" is going to be opened in Berland in the near future.

 The site administration wants to launch their project as soon as possible, that's why they

 ask you to help. You're suggested to implement the prototype of site registration system. 

The system should work on the following principle.

Each time a new user wants to register, he sends to the system a request with his name.

 If such a name does not exist in the system database, it is inserted into the database, and 

the user gets the response OK, confirming the successful registration. If the name already 

exists in the system database, the system makes up a new user name, sends it to the user 

as a prompt and also inserts the prompt into the database. The new name is formed by the

 following rule. Numbers, starting with 1, are appended one after another to name (name1,

 name2, ...), among these numbers the least i is found so that namei does not yet exist in

 the database.


输入
The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 1000 characters, which are all lowercase Latin letters.
输出
Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken.
样例输入
4abacabaacabaabacabaacab
样例输出
OKOKabacaba1OK

#include<iostream>  #include<map>  using namespace std;  int main()  {      int n;      string str;      map<string,int>mymap;      cin>>n;      while(n--)      {          cin>>str;          if(mymap[str])          cout<<str<<mymap[str]<<endl;          else          cout<<"OK"<<endl;                    mymap[str]++;      }      return 0;  }  //map是STL的映射容器  //头文件:#include<map>  //对于map<string,int>mymap,string是键值,int是数据 。   //例如:map["happy"]=6,string str="happy",那么map[str]=6;  

求次数

时间限制:1000 ms  |  内存限制:65535 KB
难度:2
描述

题意很简单,给一个数n 以及一个字符串str,区间【i,i+n-1】 为一个新的字符串,i 属于【0,strlen(str)】如果新的字符串出现过ans++,例如:acmacm n=3,那么 子串为acm cma mac acm ,只有acm出现过

求ans;

输入
LINE 1: T组数据(T<10)
LINE 2: n ,n <= 10,且小于strlen(str);
LINE 3:str
str 仅包含英文小写字母 ,切长度小于10w
输出
求 ans
样例输入
22aaaaaaa3acmacm
样例输出
51

 #include <iostream>  #include<cstdio>  #include<cstring>  #include <set>  using namespace std;  int main()  {      int T;      scanf("%d", &T);      while(T--)      {          int n,i, ans = 0;          scanf("%d", &n);          set<string> s;          string s1, s2;          cin >> s1;          int len = s1.length();          int lens=s.size();          for(i=0; i<len-n+1; i++)          {              s2=s1.substr(i,n);              s.insert(s2);              if(s.size()==lens)              {                  ans++;                }              else {lens=s.size();}          }            printf("%d\n", ans);           }      return 0;  }          

C++输入与输出—cout和cin的用法http://blog.csdn.net/zhanghaotian2011/article/details/8868577C++中string.find()函数与string::nposhttp://www.cnblogs.com/web100/archive/2012/12/02/cpp-string-find-npos.htmlfind 函数和string :: npos 的用法http://blog.csdn.net/stpeace/article/details/13069403memcpy、memmove、memset、memchr、memcmp、strstr详解http://www.cnblogs.com/jingliming/p/4737409.html使用STL的next_permutation函数生成全排列(C++)http://www.slyar.com/blog/stl_next_permutation.html优先队列详解(转载)http://www.cnblogs.com/heqinghui/archive/2013/07/30/3225407.htmlSTL 知识点总结http://blog.csdn.net/liujiuxiaoshitou/article/details/76687226






原创粉丝点击