摘要: 原题链接:http://poj.org/problem?id=1862简单题,贪心+优先队列主要练习一下stl大根堆写了几种实现方式写成类的形式还是要慢一些。。。手打的heap:1: 1 #include 2 #include 3 #include 4 #include 5 class Soluti... 阅读全文
posted @ 2015-04-25 22:28 GadyPu 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18902伸展树的区间翻转剪切。。。如下: 1 #include 2 #include 3 #include 4 #include 5 const int Ma... 阅读全文
posted @ 2015-04-25 14:25 GadyPu 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 刚考了计算机二级c有个填空题脑子一时短路写错了(>﹏2 int fun(int n, int m){3 return n == m ? 1 : n % m == 0 || 1 == n ? 0 : fun(n, m + 1);4 }5 int main(){6 return 0;7 ... 阅读全文
posted @ 2015-04-25 11:11 GadyPu 阅读(114) 评论(0) 推荐(0) 编辑