
刷题
文章平均质量分 68
zcliatb
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
A Great Alchemist
输入三条等长的s1,s2,s3. 用s1原创 2014-11-01 23:09:34 · 512 阅读 · 0 评论 -
类模板MyArray-动态内存
采用一个动态数组存储数据,有插入,追加,删除,删除元素的功能。 用链表有点浪费空间,用动态数组又增加了delete 和 new的操作。 下面代码采用动态数组的方式。 // 定义一个类模板MyArray,具有求数组长度、插入元素、追加元素、删除元素、查找元素的功能,并在main()加以验证。 #include template class MyArray { private:原创 2014-12-05 16:21:20 · 1068 阅读 · 0 评论 -
4进制加法-C++实现-分类讨论
思路: 1. 分四类讨论 2. 得到加和减计算方法 3. 前导0删除与符号删除 #include #include #include using namespace std; // 输入4进制数格式判断 bool judge(string a) { int i = 0; if(a[i] == '-' || a[i] == '+') i++; if(a原创 2014-12-06 02:14:42 · 1857 阅读 · 0 评论 -
结构体排序-c++
功能是先拍a,若a相等则在其基础上对b进行排序。 用的algorithm中sort进行的排序。 #include #include #include using namespace std; struct test{ int a; int b; test():a(0),b(0){} test(int x,int y=0):a(x),b(y){} set(原创 2014-12-06 02:38:54 · 1200 阅读 · 0 评论 -
归并-逆序数统计
归并法算逆序数,关键点: 1. 合并时候,原创 2014-11-05 18:12:35 · 598 阅读 · 0 评论 -
多路归并—败者树—简单实现
败者树每一趟,子节点与其父节点比较,原创 2014-11-06 20:39:30 · 765 阅读 · 0 评论 -
A Mountaineer
输入N,下面接N个数据,分别表示山高。原创 2014-11-01 23:27:15 · 457 阅读 · 0 评论 -
编程之美-买书问题-hashmap存储
考虑到有5种书的输入,转换为字符串,用hashmap方式存储中间过程。 采用递归方式计算。原创 2014-11-05 11:27:29 · 512 阅读 · 0 评论 -
Leetcode-candy
题目内容: There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at原创 2014-11-21 11:28:10 · 517 阅读 · 0 评论 -
Trie-Tree 实现
Trie原理: http://blog.csdn.net/hguisu/article/details/8131559原创 2014-11-11 20:55:02 · 471 阅读 · 0 评论 -
1-5入栈顺序有多少种可能出栈结果
1. 一个元素入栈出栈一种可能原创 2014-11-10 22:16:12 · 7913 阅读 · 0 评论 -
双层桶-中位数求解
fstream操作参考:http://www.cppblog.com/saga/archive/2007/06/19/26652.html 题目描述: 101个数原创 2014-11-09 16:53:23 · 840 阅读 · 0 评论 -
2015京东校招-硬币游戏
采用dp算法,记忆化搜索。 // edit by Colin // 2014-10-27 // 硬币问题,1~N个面值,整数vi~vn,两个人玩游戏,一人一次只能从头或尾部取出一个。 // 假设两人都采用最优策略,求第一个人最后所的最大硬币和 #include #define MAXN 100 using namespace std; int sum[MAXN][MAXN原创 2014-10-27 11:40:50 · 616 阅读 · 0 评论 -
结构体-heap排序
#include make_heap pop_heap push_heap原创 2014-11-04 10:50:30 · 586 阅读 · 0 评论 -
除法计算-C++-非*,/,%运算
原理: m = x1*2^y1 + x2*2^y2…… 要点: >优先级比+,-低。 顺便插一下优先级图片: 只考虑正数情况下: int divide(int x,int y) { if(x < y) return 0; int sum = 0; int te = y<<1; while(x > te) {原创 2014-12-08 21:22:23 · 1584 阅读 · 0 评论