强大的STL
文章平均质量分 68
huixisheng
无所谓结果如何,只要一直坚持并努力就好!!
展开
-
zoj 1109 我又学了一招
<br />/*<br /> Language of FatMouse<br />--------------------------------------------------------------------------------<br />Time Limit: 10 Seconds Memory Limit: 32768 KB <br />------------------------------------------------------------------------原创 2010-06-28 15:29:00 · 529 阅读 · 0 评论 -
Phone List 1671hdu
/* 这是很早做错的题目,今天看了许建峰买来的书,试了下书上的STL,AC了 很强大的STL,我决定今晚全部学完,加油! 以前做这个题目的时候题目的意思读错的,纠结啊! 查找一个串是否是另个的前缀?*/ #include//2453667 2010-05-14 19:42:26 Accepted 1671 328MS 748K 577 B C++ 悔惜晟 #include#include#incl原创 2010-05-14 19:55:00 · 400 阅读 · 0 评论 -
hdu 3456 Universal Oracle
<br />/* 这是昨天比赛很水的题目,而我却没有做出来,真是不应该的; 题目没有看仔细,What 以.结尾不要 回答的,这点注意就OK 发现STL很强大,决定好好学下。 */ #include <iostream> #include <string> #include <cstdio> using namespace std; int main() { string str; while( getline(cin, str) ) { string str1 =原创 2010-07-18 10:33:00 · 680 阅读 · 0 评论 -
hdu 3347 Calculate the expression
<br />/* 这是胡大牛给我们的讲座 Orz */ #include <iostream> #include <sstream> #include <map> #include <string> using namespace std; map<string, int> df; int main() { int t; cin >> t; while(t--) { int n; cin >> n; string a, b; int c;原创 2010-07-18 00:33:00 · 474 阅读 · 0 评论 -
全排列next_permutation的用法(稍微有点改动)
<br />/* 分析next_permutation函数执行过程: 假设数列 d1,d2,d3,d4…… 范围由[first,last)标记,调用next_permutation使数列逐次增大,这个递增过程按照字典序。 例如,在字母表中,abcd的下一单词排列为abdc,但是,有一关键点,如何确定这个下一排列为字典序中的next, 而不是next->next->next…… 若当前调用排列到达最大字典序,比如dcba,就返回false,同时重新设置该排列为最小字典序。 返回为true表示生成转载 2010-07-22 23:27:00 · 554 阅读 · 0 评论 -
STL bitset 的总结
<br />/* hdu 2051 题意:将一个十进制数转换成二进制数 */ #include <iostream> #include <bitset> using namespace std; int main(void) { int n; bitset<10> res = 0; //bitset<10> res = 1 只能使 res[0] = 1; while(cin >> n) { res = n; int原创 2010-07-23 23:43:00 · 755 阅读 · 0 评论 -
hdu 1075 map 的应用可以字符串的hash
<br />/*<br /> 好强大的STL。但是为何效率不高呢?看来字符串完全可以这个hash了<br />*/<br />#include<iostream>//2524740 2010-06-07 23:18:42 Accepted 1075 1656MS 37584K 631 B C++ 悔惜晟 <br />#include<cstdio><br />#include<map><br />#include<string><br />using namespace std;<br />map<stri原创 2010-06-07 23:36:00 · 411 阅读 · 0 评论