摘要: this example is from chapter 4 in 《the introduction to algorithm》the main idea is all showed in the book , i think maybe realizing the algorithm is a ... 阅读全文
posted @ 2014-09-22 20:20 maverick_fu 阅读(195) 评论(0) 推荐(0) 编辑
摘要: the problem is from PAT,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1063 At first, i decide use a for loop to get the intersection, which time complexity is O(n * log(n)) ,but it t... 阅读全文
posted @ 2014-09-17 16:42 maverick_fu 阅读(165) 评论(0) 推荐(0) 编辑
摘要: the problem is from PAT,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1085At first, i decide to write the code as follows:/*firstly: ... 阅读全文
posted @ 2014-09-16 21:39 maverick_fu 阅读(155) 评论(0) 推荐(0) 编辑
摘要: the problem is from PAT,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1015 this problem is relatively easy.if there must be something which need to be noticed, i think “1 is not a pr... 阅读全文
posted @ 2014-09-16 21:12 maverick_fu 阅读(112) 评论(0) 推荐(0) 编辑
摘要: /*to solve the problem ,i think we can use stack to maintain the numbers,and list to keep it sorted,which is very important to find the Median number.... 阅读全文
posted @ 2014-09-15 17:19 maverick_fu 阅读(141) 评论(0) 推荐(0) 编辑
摘要: this problem is from PAT, which website is http://pat.zju.edu.cn/contests/pat-a-practise/1050.firstly i think i can use double circulation to solve it... 阅读全文
posted @ 2014-09-15 09:49 maverick_fu 阅读(102) 评论(0) 推荐(0) 编辑
摘要: the problem is from PAT,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1083and the source code is as followed./*firstly: sort the arra... 阅读全文
posted @ 2014-09-12 23:53 maverick_fu 阅读(131) 评论(0) 推荐(0) 编辑
摘要: tips:the chinese problem is the basic level of pat ,neverthless And it makes sense that it isput under the dir of pat./*firstly: sort the array using ... 阅读全文
posted @ 2014-09-12 11:20 maverick_fu 阅读(684) 评论(0) 推荐(0) 编辑
摘要: the problem is from pat,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1043 and the source code is as followed. #include #include #include using namespace std; int pos; struct cell ... 阅读全文
posted @ 2014-09-11 20:12 maverick_fu 阅读(186) 评论(0) 推荐(0) 编辑
摘要: the problem is from pat,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1020and the source code is as followed.#include#include#include... 阅读全文
posted @ 2014-09-11 17:23 maverick_fu 阅读(177) 评论(0) 推荐(0) 编辑