由于是ABC, 所以ABC题过于简单就咕咕咕了 D Line++ 枚举一下所有组判断一下即可 F Distributing Integers 暂时咕咕咕 ...
分类:
其他好文 时间:
2020-03-28 23:38:59
阅读次数:
125
? 先考虑如何判断一个询问集是否合法。 考虑询问一次$[l,r]$,能把$[1,l 1]∪[r+1,n]$和$[l,r]$区分开来。 现在定义一个块为一个没有被区分开极大的点集合。 当所有块的大小都是1的时候,这个方案就是合法。 ? 性质: 1.一个块是由若干连续段组成,比如下面这样: 111223 ...
分类:
其他好文 时间:
2020-03-28 23:33:05
阅读次数:
84
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a ...
分类:
其他好文 时间:
2020-03-28 13:19:11
阅读次数:
58
注:LeetCode--树专题。 题目链接(1305):https://leetcode-cn.com/problems/all-elements-in-two-binary-search-trees/ 题目描述: 给你 root1 和 root2 这两棵二叉搜索树。 请你返回一个列表,其中包含 两 ...
分类:
其他好文 时间:
2020-03-27 21:47:16
阅读次数:
80
This time, you are supposed to find A×B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occu ...
分类:
其他好文 时间:
2020-03-27 21:20:29
阅读次数:
79
Problem : There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time com ...
分类:
其他好文 时间:
2020-03-27 18:31:14
阅读次数:
78
Sometimes you'd like to measure how two implementations compare in regards to run time. In this lesson you will learn how to quickly do this using Con ...
分类:
Web程序 时间:
2020-03-26 19:44:25
阅读次数:
87
"Link" 首先答案显然不可能是$1$。 然后有一个很显然的方法是把度数最小的点的所有边删掉,注意到总的度数为$4n 4$,所以一定存在某个点度数不大于$3$,因此答案不大于$3$。 那么可行的答案就只有$2,3$。 也就是说要么两棵树各割掉一条边,要么一棵树割一条边另一棵树割两条边。 我们枚举割 ...
分类:
其他好文 时间:
2020-03-26 19:09:27
阅读次数:
66
归并排序(Merge Sort) 和选择排序一样,归并排序的性能不受输入数据的影响,但表现比选择排序好的多,因为始终都是O(n log n)的时间复杂度。代价是需要额外的内存空间。 归并排序是建立在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典 ...
分类:
编程语言 时间:
2020-03-26 16:28:37
阅读次数:
93
题意:在BST中寻找两个节点,使它们的和为一个给定值。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(in ...
分类:
其他好文 时间:
2020-03-26 01:22:25
阅读次数:
70