• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Hug_Sea
博客园    首页    新随笔    联系   管理    订阅  订阅

文章分类 -  STL

POJ-1256 Anagram

摘要:题意:给出一字符串,求出所有按字母顺序排序的全排列。思路:STL库函数-next_permutation(),全排列函数。题目链接:http://poj.org/problem?id=1256View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <string> 5 #include <algorithm> 6 #include <iostream> 7 using namespace std; 8 const in 阅读全文
posted @ 2012-06-04 19:49 Hug_Sea 阅读(160) 评论(0) 推荐(0)
STL-全排列 next_permutation

摘要:// 若使用next_permutation函数,必须先将原序列排序! // 另外,库中另一函数prev_permutation与next_permutation相反,由原排列得到字典序中上一次最近排列。 #include <cstdio>#include <cstring>#include <cstdlib>#include <cmath>#include <string>#include <algorithm>#include <iostream>using namespace std;const int 阅读全文
posted @ 2012-06-04 19:04 Hug_Sea 阅读(176) 评论(0) 推荐(0)
map-排序

摘要:突然间发现,Map中的元素是自动按key升序排序的。附代码:View Code 1 #include <map> 2 #include <iostream> 3 using namespace std; 4 5 int main( ) 6 { 7 // freopen("data.in","r",stdin); 8 // freopen("data.out","w",stdout); 9 10 map <int, int> m1; 11 map <int, int>: 阅读全文
posted @ 2012-05-10 17:14 Hug_Sea 阅读(141) 评论(0) 推荐(0)
ZOJ 3185 List Operations

摘要:题意:字符串a+b or a-b例:Sample Input[1,2,3] ++ [1,2,3][a,b,c,t,d,e,t,x,y,t] -- [t][a,b,c,t,d,e,t,x,y,t] -- [t,t,t,t][123] ++ [456].Sample Output[1,2,3,1,2,3][a,b,c,d,e,t,x,y,t][a,b,c,d,e,x,y][123,456]思路:vector。。。。。。。。题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3185View Code 1 #inclu. 阅读全文
posted @ 2012-05-05 23:14 Hug_Sea 阅读(153) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3