摘要: 03-树3 Tree Traversals Again (25分) An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that w 阅读全文
posted @ 2020-03-08 20:11 liuyongliu 阅读(258) 评论(0) 推荐(0)
摘要: 03-树1 树的同构 (25分) 给定两棵树T1和T2。如果T1可以通过若干次左右孩子互换就变成T2,则我们称两棵树是“同构”的。例如图1给出的两棵树就是同构的,因为我们把其中一棵树的结点A、B、G的左右孩子互换后,就得到另外一棵树。而图2就不是同构的。 图1 图2 现给定两棵树,请你判断它们是否是 阅读全文
posted @ 2020-03-04 21:04 liuyongliu 阅读(408) 评论(0) 推荐(0)
摘要: Maximum Subsequence Sum 最大子序列和 在线处理法 稍加修改, 记录最大和的位置 1 #include<iostream> 2 using namespace std; 3 4 int K; 5 int d[100006]; 6 int main() 7 { 8 cin>>K; 阅读全文
posted @ 2020-02-17 15:02 liuyongliu 阅读(243) 评论(0) 推荐(0)
摘要: CREATE PROCEDURE prod(IN in_count INT) BEGIN DECLARE COUNT INT DEFAULT 0; WHILE COUNT < in_count DO insert demo select * from demo; SET COUNT = COUNT 阅读全文
posted @ 2019-11-14 11:06 liuyongliu 阅读(2198) 评论(0) 推荐(0)
摘要: Frogger POJ - 2253 本题需要维护的不是最短路径的估计值,而是路径最大边权的最小估计值 因此只需要修改一下relax即可 #include<iostream> #include<vector> #include<queue> #include<cmath> #include<cstr 阅读全文
posted @ 2019-11-10 18:59 liuyongliu 阅读(209) 评论(0) 推荐(0)
摘要: Kuchiguse (20) 时间限制 1000 ms 内存限制 65536 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小) 题目描述 The Japanese language is notorious for its sentence ending particle 阅读全文
posted @ 2019-07-26 16:03 liuyongliu 阅读(149) 评论(0) 推荐(0)
摘要: 1098. Insertion or Heap Sort (25) 时间限制 1000 ms 内存限制 65536 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小) 分析: 题目大意:给出n和n个数的序列a和b,a为原始序列,b为排序其中的一个步骤,问b是a经过了堆排序还 阅读全文
posted @ 2019-07-24 14:19 liuyongliu 阅读(209) 评论(0) 推荐(0)
摘要: Consecutive Factors (20) 时间限制 1000 ms 内存限制 65536 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小) 题目描述 Among all the factors of a positive integer N, there may 阅读全文
posted @ 2019-07-19 14:13 liuyongliu 阅读(298) 评论(0) 推荐(0)
摘要: Dijkstra 阅读全文
posted @ 2019-07-18 15:36 liuyongliu 阅读(430) 评论(0) 推荐(0)
摘要: 例题: Til the Cows Come Home https://vjudge.net/problem/POJ-2387 Bessie is out in the field and wants to get back to the barn to get as much sleep as po 阅读全文
posted @ 2019-07-18 11:49 liuyongliu 阅读(1057) 评论(0) 推荐(1)