摘要: map函数的启蒙篇,如何实现字符串对于数值的映射达到查重效果(map中同一个元素只能存在一次)。 map函数提供了find()以及count()。 include include include include include using namespace std; vector word; ma 阅读全文
posted @ 2018-08-19 20:57 ronnie14165 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 代码来自蓝书第三章第一题,思路很清晰。主要实现过程中需要区分以下数据结构: stack queue priority_queue include include include include using namespace std; const int maxn = 1000 + 10; int 阅读全文
posted @ 2018-08-19 20:50 ronnie14165 阅读(268) 评论(0) 推荐(0) 编辑
摘要: UVA 11729 大体是贪心做法,执行时间长的先交代 训练指南原题解 include include include using namespace std; struct Job { int j, b; bool operator x.j; } }; int main() { int n, b, 阅读全文
posted @ 2018-08-18 00:05 ronnie14165 阅读(128) 评论(0) 推荐(0) 编辑
摘要: STL入门教程 写在前面:博主在学习STL的时候遇到了很多困扰,博主认为其根本原因是因为大多数初学者同笔者一样,急于求成,想尽快实现自己需要的功能,特别是对迭代器了解不深。笔者希望通过这篇文章,让各位读者真正认识STL这个常见、方便而优秀的模板库,也希望这篇博文成为最优秀STL入门教程之一。 STL 阅读全文
posted @ 2018-08-17 20:27 ronnie14165 阅读(541) 评论(0) 推荐(0) 编辑
摘要: UVA 725sprintf(buf, "%05d%05d", abcde, fghij);0补位,避免153078 / 02469 = 62数据出现。153078 / 02469 = 62中,153078 / 2469 = 62,由于没有补位,也整好满足相除等于62... 阅读全文
posted @ 2018-08-17 20:26 ronnie14165 阅读(73) 评论(0) 推荐(0) 编辑
摘要: UVA 11059#includeusing namespace std;int main() { int S[20], kase = 0, n; while(cin >> n && n) { for(int i = 0; i > S... 阅读全文
posted @ 2018-08-17 20:26 ronnie14165 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 输入输出相同#includechar*s="#include%cchar*s=%c%s%c;main(){printf(s,10,34,s,34);}";main(){printf(s,10,34,s,34);} 阅读全文
posted @ 2018-08-17 20:26 ronnie14165 阅读(256) 评论(0) 推荐(0) 编辑
摘要: UVA 10815 set#include#include#include#includeusing namespace std;set dict;string s, buf;int main() { while(cin >> s) //???这里需要Ctrl+... 阅读全文
posted @ 2018-08-17 20:18 ronnie14165 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 背包问题模板const int MAXN = 101;const int SIZE = 50001;int dp[SIZE];int volume[MAXN], value[MAXN], c[MAXN];int n, v; // 总物品数,背包... 阅读全文
posted @ 2018-08-15 10:42 ronnie14165 阅读(91) 评论(0) 推荐(0) 编辑
摘要: HDU 2602 Bone Collector(dp之01背包问题)题目描述:典型的01背包问题。 #include #include #include #define N 1010using namespace std; int dp[N][N]; int tem... 阅读全文
posted @ 2018-08-13 12:27 ronnie14165 阅读(71) 评论(0) 推荐(0) 编辑