【TimeGate】 https://www.luogu.org/problem/P1351 【解题思路】 枚举每一个点; 然后枚举可以连到他的点; 然后对着些点直接统计答案就好了; ...
分类:
其他好文 时间:
2019-09-22 01:30:17
阅读次数:
78
【timegate】 https://www.luogu.org/problem/P1168 【解题思路】 使用两个堆,大根堆维护较小的值,小根堆维护较大的值 即小根堆的堆顶是较大的数中最小的,大根堆的堆顶是较小的数中最大的 【code】 ...
分类:
其他好文 时间:
2019-09-22 01:15:07
阅读次数:
77
给定一个二叉搜索树(Binary Search Tree),把它转换成为累加树(Greater Tree),使得每个节点的值是原来的节点值加上所有大于它的节点值之和。 例如: 输入: 二叉搜索树: 5 / \ 2 13 输出: 转换为累加树: 18 / \ 20 13 来源:力扣(LeetCode) ...
分类:
其他好文 时间:
2019-09-21 23:44:57
阅读次数:
182
【timegate】 https://www.luogu.org/problem/P4328 【解题思路】 广搜详见注释 【code】 ...
分类:
其他好文 时间:
2019-09-18 01:41:01
阅读次数:
115
【TImeGate】 https://www.luogu.org/problem/P5118 【解题思路】 dfs+模拟 【code】 具体思路见代码 ...
分类:
其他好文 时间:
2019-09-18 01:15:40
阅读次数:
93
问题描述: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of ...
分类:
编程语言 时间:
2019-09-16 09:46:31
阅读次数:
94
题目描述 输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则。 解题思路 两种解法:递归和非递归 这个题目就是归并排序中的归并操作,将两个有序数组(链表)合并为一个有序的数组。 非递归: 第一个while循环,将 l1 和 l2 进行比较,谁小谁就合并到 li ...
分类:
其他好文 时间:
2019-09-15 09:16:04
阅读次数:
145
【TimeGate】 https://www.luogu.org/problem/P3608 【解题思路】 单点修改+区间查询,用树状数组来维护f数组即可 【code】 ...
分类:
其他好文 时间:
2019-09-15 01:24:26
阅读次数:
93
[TimeGate] https://www.luogu.org/problem/P2701 【解题思路】 f[i][j]=min(min(f[i][j-1],f[i-1][j]),f[i-1][j-1])+1; f(i, j)表示以(i, j)为右下角的最大正方形的边长。 【code】 ...
分类:
其他好文 时间:
2019-09-15 01:15:06
阅读次数:
82
题目如下: You have an infinite number of stacks arranged in a row and numbered (left to right) from 0, each of the stacks has the same maximum capacity. I ...
分类:
其他好文 时间:
2019-09-14 22:40:06
阅读次数:
116