摘要: #include<iostream>#include<math.h>#include<cstring>using namespace std;class min_heap{ int* heap; int size; int flag;public: min_heap(); void print(); 阅读全文
posted @ 2020-12-15 20:28 Waiting-lwt 阅读(96) 评论(0) 推荐(0)
摘要: Running Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8597 Accepted: 3213 Description The cows are trying to become better athletes, so B 阅读全文
posted @ 2020-07-16 17:43 Waiting-lwt 阅读(77) 评论(0) 推荐(0)
摘要: Description 73 88 1 02 7 4 44 5 2 6 5(Figure 1) Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on 阅读全文
posted @ 2020-07-01 17:30 Waiting-lwt 阅读(79) 评论(0) 推荐(0)
摘要: Description 给定一个长度为n的数列ai,求ai的子序列bi的最长长度,满足bi&bi-1!=0(2<=i<=len)。 Input 输入文件共2行。 第一行包括一个整数n。 第二行包括n个整数,第i个整数表示ai。 Output 输出文件共一行。 包括一个整数,表示子序列bi的最长长度。 阅读全文
posted @ 2020-07-01 16:59 Waiting-lwt 阅读(114) 评论(0) 推荐(0)
摘要: Pop Sequence:: Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to te 阅读全文
posted @ 2020-06-27 12:46 Waiting-lwt 阅读(96) 评论(0) 推荐(0)
摘要: Reversing Linked List Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, give 阅读全文
posted @ 2020-06-25 11:34 Waiting-lwt 阅读(120) 评论(0) 推荐(0)
摘要: 啊啊啊。小白第一次写还有点儿紧张。。。算是给自己的小记录吧。 看了b站视频,从二进制角度解决递归问题(汉诺塔问题):https://www.bilibili.com/video/BV1rs411Y76X 小想法:递归问题可利用二进制算法解决;而对于任意进制的算法定义是递归的。进位算法和递归的本质上是 阅读全文
posted @ 2020-06-07 12:26 Waiting-lwt 阅读(152) 评论(0) 推荐(0)